1 | public class ExportDriversAction extends SquirrelAction ↵ | | 1 | public class ExportSettingsAction extends SquirrelAction↵
|
2 | {↵ | | 2 | {↵
|
3 | private static final StringManager s_stringMgr =↵ | | 3 | private static final StringManager s_stringMgr =↵
|
4 | StringManagerFactory.getStringManager(ExportDriversAction.class);↵ | | 4 | StringManagerFactory.getStringManager(ExportSettingsAction.class);↵
|
|
|
5 | /** Application API. */↵ | | 5 | /** Application API. */↵
|
6 | private final IApplication _app;↵ | | 6 | private final IApplication _app;↵
|
|
7 | /** Current plugin. */↵ | | 7 | /** Current plugin. */↵
|
8 | private final ExportConfigPlugin _plugin;↵ | | 8 | private final ExportConfigPlugin _plugin;↵
|
|
9 | /**↵ | | 9 | /**↵
|
10 | * Ctor.↵ | | 10 | * Ctor.↵
|
11 | *↵ | | 11 | *↵
|
12 | * @param app Application API.↵ | | 12 | * @param app Application API.↵
|
13 | * @param rsrc Plugins resources.↵ | | 13 | * @param rsrc Plugins resources.↵
|
14 | * @param plugin This plugin.↵ | | 14 | * @param plugin This plugin.↵
|
15 | *↵ | | 15 | *↵
|
16 | * @throws IllegalArgumentException↵ | | 16 | * @throws IllegalArgumentException↵
|
17 | * Thrown if a�<TT>null</TT> <TT>IApplication</TT>,↵ | | 17 | * Thrown if a�<TT>null</TT> <TT>IApplication</TT>,↵
|
18 | * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.↵ | | 18 | * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.↵
|
19 | *↵ | | 19 | *↵
|
20 | * @throws IllegalArgumentException↵ | | 20 | * @throws IllegalArgumentException↵
|
21 | * Thrown if an invalid <TT>checktype</TT> passed.↵ | | 21 | * Thrown if an invalid <TT>checktype</TT> passed.↵
|
22 | */↵ | | 22 | */↵
|
23 | public ExportDriversAction(IApplication app, Resources rsrc,↵ | | 23 | public ExportSettingsAction(IApplication app, Resources rsrc,↵
|
24 | ExportConfigPlugin plugin)↵ | | 24 | ExportConfigPlugin plugin)↵
|
25 | {↵ | | 25 | {↵
|
26 | super(app, rsrc);↵ | | 26 | super(app, rsrc);↵
|
27 | if (app == null)↵ | | 27 | if (app == null)↵
|
28 | {↵ | | 28 | {↵
|
29 | throw new IllegalArgumentException("IApplication == null");↵ | | 29 | throw new IllegalArgumentException("IApplication == null");↵
|
30 | }↵ | | 30 | }↵
|
31 | if (rsrc == null)↵ | | 31 | if (rsrc == null)↵
|
32 | {↵ | | 32 | {↵
|
33 | throw new IllegalArgumentException("Resources == null");↵ | | 33 | throw new IllegalArgumentException("Resources == null");↵
|
34 | }↵ | | 34 | }↵
|
35 | if (plugin == null)↵ | | 35 | if (plugin == null)↵
|
36 | {↵ | | 36 | {↵
|
37 | throw new IllegalArgumentException("ExportConfigPlugin == null");↵ | | 37 | throw new IllegalArgumentException("ExportConfigPlugin == null");↵
|
38 | }↵ | | 38 | }↵
|
|
39 | _app = app;↵ | | 39 | _app = app;↵
|
40 | _plugin = plugin;↵ | | 40 | _plugin = plugin;↵
|
41 | }↵ | | 41 | }↵
|
|
42 | public void actionPerformed(ActionEvent evt)↵ | | 42 | public void actionPerformed(ActionEvent evt)↵
|
43 | {↵ | | 43 | {↵
|
44 | try↵ | | 44 | try↵
|
45 | {↵ | | 45 | {↵
|
46 | new ExportDriversCommand(getParentFrame(evt), _plugin).execute();↵ | | 46 | new ExportSettingsCommand(getParentFrame(evt), _plugin).execute();↵
|
47 | }↵ | | 47 | }↵
|
48 | catch (BaseException ex)↵ | | 48 | catch (BaseException ex)↵
|
49 | {↵ | | 49 | {↵
|
50 | // i18n[exportconfig.errorSavingDrivers=Error saving drivers]↵ | | 50 | // i18n[exportconfig.errorSavingAliases=Error saving aliases] ↵
|
51 | _app.showErrorDialog(s_stringMgr.getString("exportconfig.errorSavingDrivers"), ex) | | 51 | _app.showErrorDialog(s_stringMgr.getString("exportconfig.errorSavingAliases"), ex)
|