Search in sources :

Example 6 with SQLEditor

use of net.sourceforge.sqlexplorer.plugin.editors.SQLEditor in project tdq-studio-se by Talend.

the class AppendToEditorAction method isEnabled.

public boolean isEnabled() {
    TableItem[] ti = _table.getSelection();
    if (ti == null || ti.length == 0) {
        return false;
    }
    IWorkbenchPage page = SQLExplorerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (page == null) {
        return false;
    }
    if (page.getActiveEditor() == null) {
        return false;
    }
    if (!(page.getActiveEditor() instanceof SQLEditor)) {
        return false;
    }
    return true;
}
Also used : SQLEditor(net.sourceforge.sqlexplorer.plugin.editors.SQLEditor) TableItem(org.eclipse.swt.widgets.TableItem) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Aggregations

SQLEditor (net.sourceforge.sqlexplorer.plugin.editors.SQLEditor)6 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)6 SQLEditorInput (net.sourceforge.sqlexplorer.plugin.editors.SQLEditorInput)4 TableItem (org.eclipse.swt.widgets.TableItem)3 User (net.sourceforge.sqlexplorer.dbproduct.User)2 TableNode (net.sourceforge.sqlexplorer.dbstructure.nodes.TableNode)2 SQLHistoryElement (net.sourceforge.sqlexplorer.history.SQLHistoryElement)2 PartInitException (org.eclipse.ui.PartInitException)2 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 ConnectionsView (net.sourceforge.sqlexplorer.connections.ConnectionsView)1 Alias (net.sourceforge.sqlexplorer.dbproduct.Alias)1 ColumnNode (net.sourceforge.sqlexplorer.dbstructure.nodes.ColumnNode)1 OpenPasswordConnectDialogAction (net.sourceforge.sqlexplorer.plugin.actions.OpenPasswordConnectDialogAction)1 ExecSQLAction (net.sourceforge.sqlexplorer.sqleditor.actions.ExecSQLAction)1 ITableInfo (net.sourceforge.squirrel_sql.fw.sql.ITableInfo)1 PrimaryKeyInfo (net.sourceforge.squirrel_sql.fw.sql.PrimaryKeyInfo)1 SQLDatabaseMetaData (net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData)1 TableColumnInfo (net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo)1 IEditorInput (org.eclipse.ui.IEditorInput)1