01: package net.sourceforge.squirrel_sql.plugins.sqlscript;
02:
03: import net.sourceforge.squirrel_sql.client.session.ISession;
04: import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
05: import net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI;
06: import net.sourceforge.squirrel_sql.client.gui.session.BaseSessionInternalFrame;
07: import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
08: import net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame;
09: import net.sourceforge.squirrel_sql.client.gui.session.ObjectTreeInternalFrame;
10: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
11: import net.sourceforge.squirrel_sql.fw.util.StringManager;
12:
13: /**
14: * This class was introduced to make the plugin compilable for the time it takes
15: * to completely introduce the multible session windows framework.
16: * It may be removed after that.
17: */
18: public class FrameWorkAcessor {
19:
20: private static final StringManager s_stringMgr = StringManagerFactory
21: .getStringManager(FrameWorkAcessor.class);
22:
23: public static ISQLPanelAPI getSQLPanelAPI(ISession session,
24: SQLScriptPlugin plugin) {
25: // old version before multible sesssion windows
26: //return session.getSQLPanelAPI(plugin);
27:
28: if (session.getActiveSessionWindow() instanceof ObjectTreeInternalFrame) {
29: // i18n[sqlscript.scriptWritten=Script was written to the SQL editor of the main session window.]
30: session.showMessage(s_stringMgr
31: .getString("sqlscript.scriptWritten"));
32: return session.getSessionSheet().getSQLPaneAPI();
33: } else {
34: return session.getSQLPanelAPIOfActiveSessionWindow();
35: }
36: }
37:
38: public static IObjectTreeAPI getObjectTreeAPI(ISession session,
39: SQLScriptPlugin sqlScriptPlugin) {
40: // old version
41: //return session.getObjectTreeAPI(sqlScriptPlugin);
42:
43: return session.getObjectTreeAPIOfActiveSessionWindow();
44: }
45: }
|