01: package net.sourceforge.squirrel_sql.plugins.dbdiff.actions;
02:
03: /*
04: * Copyright (C) 2007 Rob Manning
05: * manningr@users.sourceforge.net
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * as published by the Free Software Foundation; either version 2
10: * of the License, or any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20: */
21: import java.awt.event.ActionEvent;
22:
23: import net.sourceforge.squirrel_sql.client.IApplication;
24: import net.sourceforge.squirrel_sql.client.action.SquirrelAction;
25: import net.sourceforge.squirrel_sql.client.session.ISession;
26: import net.sourceforge.squirrel_sql.client.session.action.ISessionAction;
27: import net.sourceforge.squirrel_sql.fw.util.Resources;
28: import net.sourceforge.squirrel_sql.plugins.dbdiff.DBDiffPlugin;
29: import net.sourceforge.squirrel_sql.plugins.dbdiff.commands.SelectCommand;
30:
31: public class SelectAction extends SquirrelAction implements
32: ISessionAction {
33:
34: /** Current session. */
35: private ISession _session;
36:
37: /** Current plugin. */
38: private final DBDiffPlugin _plugin;
39:
40: public SelectAction(IApplication app, Resources rsrc,
41: DBDiffPlugin plugin) {
42: super (app, rsrc);
43: _plugin = plugin;
44: }
45:
46: public void actionPerformed(ActionEvent evt) {
47: if (_session != null) {
48: new SelectCommand(_session, _plugin).execute();
49: }
50: }
51:
52: /**
53: * Set the current session.
54: *
55: * @param session The current session.
56: */
57: public void setSession(ISession session) {
58: _session = session;
59: }
60: }
|