Search in sources :

Example 1 with RouteComponent

use of com.twinsoft.convertigo.beans.mobile.components.RouteComponent in project convertigo by convertigo.

the class EnableMobileRouteComponentAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(RouteComponent.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                RouteComponent component = (RouteComponent) treeObject.getObject();
                component.setEnabled(true);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : RouteComponent(com.twinsoft.convertigo.beans.mobile.components.RouteComponent) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Example 2 with RouteComponent

use of com.twinsoft.convertigo.beans.mobile.components.RouteComponent in project convertigo by convertigo.

the class EnableMobileRouteComponentAction 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;
            RouteComponent component = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof MobileRouteComponentTreeObject) {
                    MobileRouteComponentTreeObject componentTreeObject = (MobileRouteComponentTreeObject) treeObject;
                    component = (RouteComponent) componentTreeObject.getObject();
                    component.setEnabled(true);
                    componentTreeObject.setEnabled(true);
                    componentTreeObject.hasBeenModified(true);
                    TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", false, true);
                    explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
                }
            }
            explorerView.refreshSelectedTreeObjects();
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to enable route!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) RouteComponent(com.twinsoft.convertigo.beans.mobile.components.RouteComponent) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) MobileRouteComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteComponentTreeObject) MobileRouteComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteComponentTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) TreeObjectEvent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display)

Example 3 with RouteComponent

use of com.twinsoft.convertigo.beans.mobile.components.RouteComponent in project convertigo by convertigo.

the class DisableMobileRouteComponentAction 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;
            RouteComponent component = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof MobileRouteComponentTreeObject) {
                    MobileRouteComponentTreeObject componentTreeObject = (MobileRouteComponentTreeObject) treeObject;
                    component = (RouteComponent) componentTreeObject.getObject();
                    component.setEnabled(false);
                    componentTreeObject.setEnabled(false);
                    componentTreeObject.hasBeenModified(true);
                    TreeObjectEvent treeObjectEvent = new TreeObjectEvent(componentTreeObject, "isEnabled", true, false);
                    explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
                }
            }
            explorerView.refreshSelectedTreeObjects();
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to disable route!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) RouteComponent(com.twinsoft.convertigo.beans.mobile.components.RouteComponent) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) MobileRouteComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteComponentTreeObject) MobileRouteComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteComponentTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) TreeObjectEvent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display)

Example 4 with RouteComponent

use of com.twinsoft.convertigo.beans.mobile.components.RouteComponent in project convertigo by convertigo.

the class DisableMobileRouteComponentAction method run2.

@Override
protected void run2() throws Exception {
    try {
        WrapObject[] treeObjects = studio.getSelectedObjects().toArray(new WrapObject[0]);
        for (int i = treeObjects.length - 1; i >= 0; --i) {
            WrapDatabaseObject treeObject = (WrapDatabaseObject) treeObjects[i];
            if (treeObject.instanceOf(RouteComponent.class)) {
                // StepView stepTreeObject = (StepView) treeObject;
                RouteComponent component = (RouteComponent) treeObject.getObject();
                component.setEnabled(false);
            // stepTreeObject.setEnabled(true);
            // stepTreeObject.hasBeenModified(true);
            // TreeObjectEvent treeObjectEvent = new TreeObjectEvent(stepTreeObject, "isEnable", false, true);
            // explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
            }
        }
    // explorerView.refreshSelectedTreeObjects();
    } catch (Throwable e) {
        throw e;
    // ConvertigoPlugin.logException(e, "Unable to enable step!");
    }
// finally {
// shell.setCursor(null);
// waitCursor.dispose();
}
Also used : RouteComponent(com.twinsoft.convertigo.beans.mobile.components.RouteComponent) WrapObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject) WrapDatabaseObject(com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)

Aggregations

RouteComponent (com.twinsoft.convertigo.beans.mobile.components.RouteComponent)4 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)2 TreeObjectEvent (com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent)2 DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)2 MobileRouteComponentTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteComponentTreeObject)2 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)2 WrapDatabaseObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapDatabaseObject)2 WrapObject (com.twinsoft.convertigo.engine.studio.views.projectexplorer.model.WrapObject)2 Cursor (org.eclipse.swt.graphics.Cursor)2 Display (org.eclipse.swt.widgets.Display)2 Shell (org.eclipse.swt.widgets.Shell)2