class ExportDriversCommand extends AbstractSaveCommand { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ExportDriversCommand.class); /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ExportDriversCommand.class); /** Parent frame. */ private final Frame _frame; /** Current plugin. */ private ExportConfigPlugin _plugin; /** * Ctor. * * @throws IllegalArgumentException * Thrown if a�<TT>null</TT> <TT>ISession</TT>, * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed. */ public ExportDriversCommand(Frame frame, ExportConfigPlugin plugin) { super(frame, plugin); _frame = frame; _plugin = plugin; } /** * Save database drivers to <TT>file</TT>. * * @param file The <TT>File</TT> to be written to. * * @throws IOException Thrown if an IO error occurs. */ protected void writeToFile(File file) throws IOException, XMLException { final DataCache cache = _plugin.getApplication().getDataCache(); cache.saveDrivers(file); } /** * Retrieve the default file name for the save. * * @return The default file name. */ protected String getDefaultFilename() { return new ApplicationFiles().getDatabaseDriversFile().getName(); } /** * Retrieve the description of the objects being saved. * * @return description of the objects being saved. */ protected String getSaveDescription() { // i18n[exportconfig.databaseDrivers=Database Drivers] return s_stringMgr.getString("exportconfig.databaseDrivers")
class ExportSettingsCommand extends AbstractSaveCommand { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ExportSettingsCommand.class); /** Logger for this class. */ private final static ILogger s_log = LoggerController.createLogger(ExportSettingsCommand.class); /** Parent frame. */ private final Frame _frame; /** Current plugin. */ private ExportConfigPlugin _plugin; /** * Ctor. * * @throws IllegalArgumentException * Thrown if a�<TT>null</TT> <TT>ISession</TT>, * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed. */ public ExportSettingsCommand(Frame frame, ExportConfigPlugin plugin) { super(frame, plugin); _frame = frame; _plugin = plugin; } /** * Save database drivers to <TT>file</TT>. * * @param file The <TT>File</TT> to be written to. * * @throws IOException Thrown if an IO error occurs. */ protected void writeToFile(File file) throws IOException, XMLException { final SquirrelPreferences prefs = _plugin.getApplication().getSquirrelPreferences(); new XMLBeanWriter(prefs).save(file); } /** * Retrieve the default file name for the save. * * @return The default file name. */ protected String getDefaultFilename() { return new ApplicationFiles().getUserPreferencesFile().getName(); } /** * Retrieve the description of the objects being saved. * * @return description of the objects being saved. */ protected String getSaveDescription() { // i18n[exportconfig.applicationSettings=Application Settings] return s_stringMgr.getString("exportconfig.applicationSettings")
Clone fragments detected by clone detection tool
File path: /sql12/plugins/exportconfig/src/net/sourceforge/squirrel_sql/plugins/exportconfig/action/ExportDriversCommand.java File path: /sql12/plugins/exportconfig/src/net/sourceforge/squirrel_sql/plugins/exportconfig/action/ExportSettingsCommand.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class ExportDriversCommand extends AbstractSaveCommand
1
class ExportSettingsCommand extends AbstractSaveCommand
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(ExportDriversCommand.class);
4
		StringManagerFactory.getStringManager(ExportSettingsCommand.class);
5
	/** Logger for this class. */
5
	/** Logger for this class. */
6
	private final static ILogger s_log =
6
	private final static ILogger s_log =
7
		LoggerController.createLogger(ExportDriversCommand.class);
7
		LoggerController.createLogger(ExportSettingsCommand.class);
8
	/** Parent frame. */
8
	/** Parent frame. */
9
	private final Frame _frame;
9
	private final Frame _frame;
10
	/** Current plugin. */
10
	/** Current plugin. */
11
	private ExportConfigPlugin _plugin;
11
	private ExportConfigPlugin _plugin;
12
	/**
12
	/**
13
	 * Ctor.
13
	 * Ctor.
14
	 *
14
	 *
15
	 * @throws	IllegalArgumentException
15
	 * @throws	IllegalArgumentException
16
	 * 			Thrown if a�<TT>null</TT> <TT>ISession</TT>,
16
	 * 			Thrown if a�<TT>null</TT> <TT>ISession</TT>,
17
	 * 			<TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.
17
	 * 			<TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.
18
	 */
18
	 */
19
	public ExportDriversCommand(Frame frame, ExportConfigPlugin plugin)
19
	public ExportSettingsCommand(Frame frame, ExportConfigPlugin plugin)
20
	{
20
	{
21
		super(frame, plugin);
21
		super(frame, plugin);
22
		_frame = frame;
22
		_frame = frame;
23
		_plugin = plugin;
23
		_plugin = plugin;
24
	}
24
	}
25
	/**
25
	/**
26
	 * Save database drivers to <TT>file</TT>.
26
	 * Save database drivers to <TT>file</TT>.
27
	 *
27
	 *
28
	 * @param	file	The <TT>File</TT> to be written to.
28
	 * @param	file	The <TT>File</TT> to be written to.
29
	 *
29
	 *
30
	 * @throws	IOException		Thrown if an IO error occurs.
30
	 * @throws	IOException		Thrown if an IO error occurs.
31
	 */
31
	 */
32
	protected void writeToFile(File file) throws IOException, XMLException
32
	protected void writeToFile(File file) throws IOException, XMLException
33
	{
33
	{
34
		final DataCache cache = _plugin.getApplication().getDataCache();
34
		final SquirrelPreferences prefs = _plugin.getApplication().get
35
		cache.saveD
35
SquirrelPreferences();
36
rivers(file);
36
		new XMLBeanWriter(prefs).save(file);
37
	}
37
	}
38
	/**
38
	/**
39
	 * Retrieve the default file name for the save.
39
	 * Retrieve the default file name for the save.
40
	 *
40
	 *
41
	 * @return	The default file name.
41
	 * @return	The default file name.
42
	 */
42
	 */
43
	protected String getDefaultFilename()
43
	protected String getDefaultFilename()
44
	{
44
	{
45
		return new ApplicationFiles().getDatabaseDriversFile().getName();
45
		return new ApplicationFiles().getUserPreferencesFile().getName();
46
	}
46
	}
47
	/**
47
	/**
48
	 * Retrieve the description of the objects being saved.
48
	 * Retrieve the description of the objects being saved.
49
	 *
49
	 *
50
	 * @return	description of the objects being saved.
50
	 * @return	description of the objects being saved.
51
	 */
51
	 */
52
	protected String getSaveDescription()
52
	protected String getSaveDescription()
53
	{
53
	{
54
		// i18n[exportconfig.databaseDrivers=Database Drivers]		
54
		// i18n[exportconfig.applicationSettings=Application Settings]
55
		return s_stringMgr.getString("exportconfig.databaseDrivers")
55
		return s_stringMgr.getString("exportconfig.applicationSettings")
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0