01: package net.sourceforge.squirrel_sql.client.session.action;
02:
03: import net.sourceforge.squirrel_sql.client.IApplication;
04: import net.sourceforge.squirrel_sql.client.action.SquirrelAction;
05: import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
06:
07: import java.awt.event.ActionEvent;
08:
09: public class CloseCurrentSQLResultTabAction extends SquirrelAction
10: implements ISQLPanelAction {
11:
12: /** Current panel. */
13: private ISQLPanelAPI _panel;
14:
15: /**
16: * Ctor specifying Application API.
17: *
18: * @param app Application API.
19: */
20: public CloseCurrentSQLResultTabAction(IApplication app) {
21: super (app);
22: }
23:
24: public void setSQLPanel(ISQLPanelAPI panel) {
25: _panel = panel;
26: setEnabled(null != _panel);
27: }
28:
29: /**
30: * Close the current result tab
31: *
32: * @param evt Event being executed.
33: */
34: public synchronized void actionPerformed(ActionEvent evt) {
35: if (_panel != null) {
36: _panel.closeCurrentResultTab();
37: }
38: }
39: }
|