1 | class FormatSQLAction extends SquirrelAction↵ | | 1 | class InQuotesAction extends SquirrelAction↵
|
2 | implements ISQLPanelAction↵ | | 2 | implements ISQLPanelAction↵
|
3 | {↵ | | 3 | {↵
|
4 | private static final StringManager s_stringMgr =↵ | | 4 | private static final StringManager s_stringMgr =↵
|
5 | StringManagerFactory.getStringManager(FormatSQLAction.class);↵ | | 5 | StringManagerFactory.getStringManager(InQuotesAction.class);↵
|
|
|
6 | /** Logger for this class. */↵ | | 6 | /** Logger for this class. */↵
|
7 | private static final ILogger s_log =↵ | | 7 | private static final ILogger s_log =↵
|
8 | LoggerController.createLogger(FormatSQLAction.class);↵ | | 8 | LoggerController.createLogger(InQuotesAction.class);↵
|
|
9 | /** Current session. */↵ | | 9 | /** Current session. */↵
|
10 | private ISession _session;↵ | | 10 | private ISession _session;↵
|
|
11 | private EditExtrasPlugin _plugin;↵ | | 11 | private EditExtrasPlugin _plugin;↵
|
|
12 | FormatSQLAction(IApplication app, EditExtrasPlugin plugin)↵ | | 12 | InQuotesAction(IApplication app, EditExtrasPlugin plugin)↵
|
13 | {↵ | | 13 | {↵
|
14 | super(app, plugin.getResources());↵ | | 14 | super(app, plugin.getResources());↵
|
15 | _plugin = plugin;↵ | | 15 | _plugin = plugin;↵
|
16 | }↵ | | 16 | }↵
|
17 | ↵ | | |
|
|
18 | public void setSQLPanel(ISQLPanelAPI panel)↵ | | 17 | public void setSQLPanel(ISQLPanelAPI panel)↵
|
19 | {↵ | | 18 | {↵
|
20 | if(null != panel)↵ | | 19 | if(null != panel)↵
|
21 | {↵ | | 20 | {↵
|
22 | _session = panel.getSession();↵ | | 21 | _session = panel.getSession();↵
|
23 | }↵ | | 22 | }↵
|
24 | else↵ | | 23 | else↵
|
25 | {↵ | | 24 | {↵
|
26 | _session = null;↵ | | 25 | _session = null;↵
|
27 | }↵ | | 26 | }↵
|
28 | setEnabled(null != _session);↵ | | 27 | setEnabled(null != _session);↵
|
29 | }↵ | | 28 | }↵
|
|
|
|
30 | public void actionPerformed(ActionEvent evt)↵ | | 29 | public void actionPerformed(ActionEvent evt)↵
|
31 | {↵ | | 30 | {↵
|
32 | if (_session != null)↵ | | 31 | if (_session != null)↵
|
33 | {↵ | | 32 | {↵
|
34 | try↵ | | 33 | try↵
|
35 | {↵ | | 34 | {↵
|
36 | new FormatSQLCommand↵ | | 35 | //new InQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();↵
|
37 | (_session, _plugin).execute();↵ | | 36 | new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();↵
|
38 | }↵ | | 37 | }↵
|
39 | catch (Throwable ex)↵ | | 38 | catch (Throwable ex)↵
|
40 | {↵ | | 39 | {↵
|
41 | // i18n[editextras.errorProcessingFormat=Error processing Format SQL command: {0}]↵ | | 40 | // i18n[editextras.errorQuoteSql=Error processing Quote SQL command: {0}]↵
|
42 | final String msg = s_stringMgr.getString("editextras.errorProcessingFormat", ex);↵ | | 41 | final String msg = s_stringMgr.getString("editextras.errorQuoteSql", ex);↵
|
43 | _session.showErrorMessage(msg);↵ | | 42 | _session.showErrorMessage(msg);↵
|
44 | s_log.error(msg, ex) | | 43 | s_log.error(msg, ex)
|