1 | public class GotoNextResultsTabAction extends SquirrelAction↵ | | 1 | public class GotoPreviousResultsTabAction extends SquirrelAction↵
|
2 | implements ISQLPanelAction↵ | | 2 | implements ISQLPanelAction↵
|
3 | {↵ | | 3 | {↵
|
4 | /** Logger for this class. */↵ | | 4 | /** Logger for this class. */↵
|
5 | private final static ILogger s_log =↵ | | 5 | private final static ILogger s_log =↵
|
6 | LoggerController.createLogger(GotoNextResultsTabAction.class);↵ | | 6 | LoggerController.createLogger(GotoPreviousResultsTabAction.class);↵
|
|
7 | /** Current panel. */↵ | | 7 | /** Current panel. */↵
|
8 | private ISQLPanelAPI _panel;↵ | | 8 | private ISQLPanelAPI _panel;↵
|
|
9 | /** Command that will be executed by this action. */↵ | | 9 | /** Command that will be executed by this action. */↵
|
10 | private ICommand _cmd;↵ | | 10 | private ICommand _cmd;↵
|
|
11 | /**↵ | | 11 | /**↵
|
12 | * Ctor specifying Application API.↵ | | 12 | * Ctor specifying Application API.↵
|
13 | *↵ | | 13 | *↵
|
14 | * @param app Application API.↵ | | 14 | * @param app Application API.↵
|
15 | */↵ | | 15 | */↵
|
16 | public GotoNextResultsTabAction(IApplication app)↵ | | 16 | public GotoPreviousResultsTabAction(IApplication app)↵
|
17 | {↵ | | 17 | {↵
|
18 | super(app);↵ | | 18 | super(app);↵
|
19 | }↵ | | 19 | }↵
|
|
20 | public void setSQLPanel(ISQLPanelAPI panel)↵ | | 20 | public void setSQLPanel(ISQLPanelAPI panel)↵
|
21 | {↵ | | 21 | {↵
|
22 | _panel = panel;↵ | | 22 | _panel = panel;↵
|
23 | _cmd = null;↵ | | 23 | _cmd = null;↵
|
24 | setEnabled(null != _panel);↵ | | 24 | setEnabled(null != _panel);↵
|
25 | }↵ | | 25 | }↵
|
|
26 | /**↵ | | 26 | /**↵
|
27 | * Display the next results tab.↵ | | 27 | * Display the previous results tab.↵
|
28 | *↵ | | 28 | *↵
|
29 | * @param evt Event being executed.↵ | | 29 | * @param evt Event being executed.↵
|
30 | */↵ | | 30 | */↵
|
31 | public synchronized void actionPerformed(ActionEvent evt)↵ | | 31 | public synchronized void actionPerformed(ActionEvent evt)↵
|
32 | {↵ | | 32 | {↵
|
33 | if (_panel != null)↵ | | 33 | if (_panel != null)↵
|
34 | {↵ | | 34 | {↵
|
35 | if (_cmd == null)↵ | | 35 | if (_cmd == null)↵
|
36 | {↵ | | 36 | {↵
|
37 | _cmd = new GotoNextResultsTabCommand(_panel);↵ | | 37 | _cmd = new GotoPreviousResultsTabCommand(_panel);↵
|
38 | }↵ | | 38 | }↵
|
39 | try↵ | | 39 | try↵
|
40 | {↵ | | 40 | {↵
|
41 | _cmd.execute();↵ | | 41 | _cmd.execute();↵
|
42 | }↵ | | 42 | }↵
|
43 | catch (Throwable ex)↵ | | 43 | catch (Throwable ex)↵
|
44 | {↵ | | 44 | {↵
|
45 | final String msg = "Error occured seting current results tab";↵ | | 45 | final String msg = "Error occured seting current results tab";↵
|
46 | _panel.getSession().showErrorMessage(msg + ": " + ex);↵ | | 46 | _panel.getSession().showErrorMessage(msg + ": " + ex);↵
|
47 | s_log.error(msg, ex) | | 47 | s_log.error(msg, ex)
|