1 | public class RefreshSchemaInfoAction extends SquirrelAction↵ | | 1 | public class ShowNativeSQLAction extends SquirrelAction↵
|
2 | implements ISessionAction↵ | | 2 | implements ISQLPanelAction↵
|
3 | {↵ | | 3 | {↵
|
4 | /** Current Object Tree. */↵ | | |
|
5 | private ISession _session;↵ | | |
|
|
6 | ↵ | | 4 | private ISQLPanelAPI _panel;↵
|
|
7 | /**↵ | | 5 | /**↵
|
8 | * Ctor specifying a↵ | | 6 | * Ctor.↵
|
| | | 7 | *↵
|
9 | pplication API.↵ | | 8 | * @param app Application API.↵
|
10 | */↵ | | 9 | */↵
|
11 | public RefreshSchemaInfoAction(IApplication app)↵ | | 10 | public ShowNativeSQLAction(IApplication app)↵
|
12 | {↵ | | |
|
13 | ↵ | | 11 | {↵
|
14 | super(app);↵ | | 12 | super(app);↵
|
15 | }↵ | | |
|
|
16 | ↵ | | 13 | }↵
|
|
17 | public void setSession(ISession session)↵ | | 14 | public void setS↵
|
18 | {↵ | | |
|
19 | _session = session;↵ | | |
|
20 | }↵ | | |
|
|
21 | ↵ | | 15 | QLPanel(ISQLPanelAPI panel)↵
|
| | | 16 | {↵
|
| | | 17 | _panel = panel;↵
|
| | | 18 | setEnabled(null != _panel);↵
|
| | | 19 | }↵
|
|
| | | 20 | /**↵
|
| | | 21 | * Perform this action. Use the <TT>ShowNativeSQLCommand</TT>.↵
|
| | | 22 | *↵
|
| | | 23 | * @param evt The current event.↵
|
| | | 24 | */↵
|
22 | public void actionPerformed(ActionEvent evt)↵ | | 25 | public void actionPerformed(ActionEvent evt)↵
|
23 | {↵ | | |
|
|
24 | if (_session != null)↵ | | |
|
25 | {↵ | | |
|
26 | IObjectTreeAPI objectTreeAPI = _session.getSessionSheet().getObjectTreePanel();↵ | | |
|
27 | ↵ | | 26 | {↵
|
| | | 27 | IApplication app = getApplication();↵
|
28 | CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame());↵ | | 28 | CursorChanger cursorChg = new CursorChanger(app.getMainFrame());↵
|
29 | cursorChg.show();↵ | | 29 | cursorChg.show();↵
|
30 | try↵ | | |
|
31 | {↵ | | |
|
32 | new RefreshObjectTreeCommand(objectTreeAPI).execute();↵ | | |
|
33 | }↵ | | |
|
34 | finally↵ | | |
|
35 | {↵ | | |
|
36 | ↵ | | 30 | try↵
|
| | | 31 | {↵
|
| | | 32 | new ShowNativeSQLCommand(_panel).execute();↵
|
| | | 33 | }↵
|
| | | 34 | finally↵
|
| | | 35 | {↵
|
37 | cursorChg.restore() | | 36 | cursorChg.restore()
|