private void updateState() { int idx = _tabPnl.getSelectedIndex(); if (idx != -1) { (_tabs.get(idx)).select(); } _session.getApplication().getActionCollection().activationChanged(_session.getSessionInternalFrame()); }
public void run() { ISQLConnection con = _session.getSQLConnection(); if (con != null) { _dmd = con.getSQLMetaData(); } } });
/** * @see net.sourceforge.squirrel_sql.client.plugin.DefaultSessionPlugin#isPluginSession(net.sourceforge.squirrel_sql.client.session.ISession) */ @Override protected boolean isPluginSession(ISession session) { return DialectFactory.isGreenplum(session.getMetaData()); }
public String[] getAllowedSchemas(ISession session) { String[] allowedSchemas = _allowedSchemasBySessionID.get(session.getIdentifier()); if(null == allowedSchemas) { allowedSchemas = getAllowedSchemas(session.getSQLConnection(), session.getAlias()); _allowedSchemasBySessionID.put(session.getIdentifier(), allowedSchemas); } return allowedSchemas; }
ObjectTreeTabbedPane(ISession session) { super(); if (session == null) { throw new IllegalArgumentException("ISession == null"); } _sessionId = session.getIdentifier(); _app = session.getApplication(); _tabPnl.putClientProperty(IClientPropertiesKeys.TABBED_PANE_OBJ, this); }
public void execute(String SQLQuery) { try { ISQLConnection conn = _session.getSQLConnection(); Statement stmt = conn.createStatement(); stmt.execute(SQLQuery); } catch (SQLException ex) { _session.showErrorMessage(ex); } }
public void execute() { final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); final StringBuffer buf = new StringBuffer(); buf.append("USE "); buf.append(_catalogName); buf.append(sqlSep + "\n"); buf.append("DBCC SHRINKFILE ("); buf.append(_databaseFileName); buf.append(", TRUNCATEONLY)\n"); buf.append(sqlSep); buf.append("\n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(buf.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
/** * Display the properties dialog. */ public void execute() { if (_session != null) { WindowManager winMgr = _session.getApplication().getWindowManager(); winMgr.showSessionPropertiesDialog(_session, _tabIndexToSelect); } } }
private String getStatementSeparator() { String statementSeparator = _session.getQueryTokenizer().getSQLStatementSeparator(); if (1 < statementSeparator.length()) { statementSeparator = "\n" + statementSeparator + "\n"; } return statementSeparator; }
private void onSchemaInfoUpdated(ISession session) { final IParserEventsProcessor parserEventsProcessor = session.getParserEventsProcessor(_session.getSessionSheet().getSQLEntryPanel().getIdentifier()); parserEventsProcessor.triggerParser(); _session.getSchemaInfo().removeSchemaInfoUpdateListener(_schemaInfoUpdateListener); _schemaInfoUpdateListener = null; } }
private void initSessionSheet(ISession session) { ActionCollection coll = getApplication().getActionCollection(); session.addSeparatorToToolbar(); session.addToToolbar(coll.get(FindAction.class)); session.addToToolbar(coll.get(ReplaceAction.class)); session.addToToolbar(coll.get(ConfigureAutoCorrectAction.class)); SessionInternalFrame sif = session.getSessionInternalFrame(); ISQLPanelAPI sqlPanelAPI = sif.getSQLPanelAPI(); new ToolsPopupHandler(this).initToolsPopup(sif, coll); completeSqlPanelEntryAreaMenu(coll, sqlPanelAPI); }
public void actionPerformed(ActionEvent evt) { if (_session != null) { IObjectTreeAPI treeAPI = _session.getSessionInternalFrame().getObjectTreeAPI(); IDatabaseObjectInfo[] dbObjs = treeAPI.getSelectedDatabaseObjects(); try { new GenerateSqlCommand(_session, _plugin, dbObjs).execute(); } catch (Throwable th) { _session.showErrorMessage(th); } } }
public ITableInfo getTableInfo() { IObjectTreeAPI treeAPI = _session.getSessionInternalFrame().getObjectTreeAPI(); IDatabaseObjectInfo[] dbInfo = treeAPI.getSelectedDatabaseObjects(); if (dbInfo[0] instanceof ITableInfo) { return (ITableInfo)dbInfo[0]; } return null; }
public String sqlExecutionException(Throwable th, String postErrorString) { SQLExecutionException ex = new SQLExecutionException(th, postErrorString); String message = _session.formatException(ex); _session.showErrorMessage(message); if (_session.getProperties().getWriteSQLErrorsToLog()) { s_log.info(message); } return message; }
public RecentFilesController(ISQLPanelAPI panel) { Frame parent = GUIUtils.getOwningFrame(panel.getSQLEntryPanel().getTextComponent()); init(panel.getSession().getApplication(), parent, panel.getSession().getAlias(), false); }
/** * Check the specified session to determine if the specified data is a keyword. * * @param session * @param data * @return */ public static boolean isKeyword(ISession session, String data) { return session.getSchemaInfo().isKeyword(data); }
public void run() { _session.getSessionSheet().setStatusBarProgress(i18n.LOADING_TABLES_MSG, 0, MAX_PROGRESS, 50); } });
public ObjectTreeInternalFrame(ISession session) { super(session.getTitle(), true, true, true, true, session); _app = session.getApplication(); setVisible(false); createGUI(session); }
private static final IDatabaseObjectInfo createDbo(ISession session) { return new DatabaseObjectInfo(null, null, session.getAlias().getName(), DatabaseObjectType.SESSION, session.getMetaData()); } }
private void showErrorMessage(Throwable th) { if (_session != null) { _session.showErrorMessage(th); } else if (_msgHandler != null) { _msgHandler.showErrorMessage(th, null); } else { s_log.error("No IMessageHandler or ISession configured"); } } }