Search in sources :

Example 6 with StatementTreeObject

use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StatementTreeObject in project convertigo by convertigo.

the class EnableStatementAction method run.

public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            DatabaseObjectTreeObject treeObject = null;
            Statement statement = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof StatementTreeObject) {
                    StatementTreeObject statementTreeObject = (StatementTreeObject) treeObject;
                    statement = (Statement) statementTreeObject.getObject();
                    statement.setEnabled(true);
                    statementTreeObject.setEnabled(true);
                    statementTreeObject.hasBeenModified(true);
                }
            }
            explorerView.refreshSelectedTreeObjects();
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to enable statement!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) StatementTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StatementTreeObject) Statement(com.twinsoft.convertigo.beans.core.Statement) StatementTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StatementTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display)

Aggregations

Statement (com.twinsoft.convertigo.beans.core.Statement)6 DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)6 StatementTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StatementTreeObject)6 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)5 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)5 Cursor (org.eclipse.swt.graphics.Cursor)5 Display (org.eclipse.swt.widgets.Display)5 Shell (org.eclipse.swt.widgets.Shell)5 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)4 StatementWithExpressions (com.twinsoft.convertigo.beans.core.StatementWithExpressions)2 HandlerStatement (com.twinsoft.convertigo.beans.statements.HandlerStatement)2 IfStatement (com.twinsoft.convertigo.beans.statements.IfStatement)2 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)1 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)1 BlockFactory (com.twinsoft.convertigo.beans.core.BlockFactory)1 Connector (com.twinsoft.convertigo.beans.core.Connector)1 Criteria (com.twinsoft.convertigo.beans.core.Criteria)1 ExtractionRule (com.twinsoft.convertigo.beans.core.ExtractionRule)1 IScreenClassContainer (com.twinsoft.convertigo.beans.core.IScreenClassContainer)1 ITablesProperty (com.twinsoft.convertigo.beans.core.ITablesProperty)1