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")
|