1 | public class CreateTableScriptAction ↵ | | 1 | public class DropTableScriptAction ↵
|
2 | extends SquirrelAction↵ | | 2 | extends SquirrelAction↵
|
3 | implements IObjectTreeAction{↵ | | 3 | implements IObjectTreeAction {↵
|
|
4 | /** Current session. */↵ | | 4 | /** Current session. */↵
|
5 | private ISession _session;↵ | | 5 | private ISession _session;↵
|
|
6 | /** Current plugin. */↵ | | 6 | /** Current plugin. */↵
|
7 | private final SQLScriptPlugin _plugin;↵ | | 7 | private final SQLScriptPlugin _plugin;↵
|
|
8 | public CreateTableScriptAction(IApplication app, Resources rsrc,↵ | | 8 | public DropTableScriptAction(IApplication app, Resources rsrc,↵
|
9 | SQLScriptPlugin plugin) {↵ | | 9 | SQLScriptPlugin plugin) {↵
|
10 | super(app, rsrc);↵ | | 10 | super(app, rsrc);↵
|
11 | _plugin = plugin;↵ | | 11 | _plugin = plugin;↵
|
12 | }↵ | | 12 | }↵
|
|
13 | public void actionPerformed(ActionEvent evt) {↵ | | 13 | public void actionPerformed(ActionEvent evt) {↵
|
14 | if (_session != null) {↵ | | 14 | if (_session != null) {↵
|
15 | new CreateTableScriptCommand(_session, _plugin).execute();↵ | | 15 | new DropTableScriptCommand(_session, _plugin).execute();↵
|
16 | }↵ | | 16 | }↵
|
17 | }↵ | | 17 | }↵
|
|
18 | /**↵ | | 18 | /**↵
|
19 | * Set the current session.↵ | | 19 | * Set the current session.↵
|
20 | * ↵ | | 20 | * ↵
|
21 | * @param session The current session.↵ | | 21 | * @param session The current session.↵
|
22 | */↵ | | 22 | */↵
|
23 | public void setSession(ISession session) {↵ | | 23 | public void setSession(ISession session) {↵
|
24 | _session = session;↵ | | 24 | _session = session;↵
|
25 | }↵ | | 25 | }↵
|
|
26 | public void setObjectTree(IObjectTreeAPI tree)↵ | | 26 | public void setObjectTree(IObjectTreeAPI tree)↵
|
27 | {↵ | | 27 | {↵
|
28 | if(null != tree)↵ | | 28 | if(null != tree)↵
|
29 | {↵ | | 29 | {↵
|
30 | _session = tree.getSession();↵ | | 30 | _session = tree.getSession();↵
|
31 | }↵ | | 31 | }↵
|
32 | else↵ | | 32 | else↵
|
33 | {↵ | | 33 | {↵
|
34 | _session = null;↵ | | 34 | _session = null;↵
|
35 | }↵ | | 35 | }↵
|
36 | setEnabled(null != _session) | | 36 | setEnabled(null != _session)
|