Search in sources :

Example 21 with DatabaseObjectTreeObject

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

the class EnableListenerAction 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;
            Listener listener = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof ListenerTreeObject) {
                    ListenerTreeObject listenerTreeObject = (ListenerTreeObject) treeObject;
                    listener = (Listener) listenerTreeObject.getObject();
                    listener.setEnabled(true);
                    listenerTreeObject.setEnabled(true);
                    listenerTreeObject.hasBeenModified(true);
                    // Updating the tree
                    explorerView.refreshTreeObject(listenerTreeObject);
                }
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to enable listener!");
    } 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) Listener(com.twinsoft.convertigo.beans.core.Listener) ListenerTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ListenerTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) Cursor(org.eclipse.swt.graphics.Cursor) ListenerTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ListenerTreeObject) Display(org.eclipse.swt.widgets.Display)

Example 22 with DatabaseObjectTreeObject

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

the class EnableMobilePageComponentAction 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;
            PageComponent component = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof MobilePageComponentTreeObject) {
                    MobilePageComponentTreeObject componentTreeObject = (MobilePageComponentTreeObject) treeObject;
                    component = (PageComponent) 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 page!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) MobilePageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobilePageComponentTreeObject) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) MobilePageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobilePageComponentTreeObject) 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) PageComponent(com.twinsoft.convertigo.beans.mobile.components.PageComponent) Display(org.eclipse.swt.widgets.Display)

Example 23 with DatabaseObjectTreeObject

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

the class EnableMobileRouteActionComponentAction 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;
            RouteActionComponent component = null;
            TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
            for (int i = treeObjects.length - 1; i >= 0; i--) {
                treeObject = (DatabaseObjectTreeObject) treeObjects[i];
                if (treeObject instanceof MobileRouteActionComponentTreeObject) {
                    MobileRouteActionComponentTreeObject componentTreeObject = (MobileRouteActionComponentTreeObject) treeObject;
                    component = (RouteActionComponent) 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 action!");
    } 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) RouteActionComponent(com.twinsoft.convertigo.beans.mobile.components.RouteActionComponent) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) MobileRouteActionComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteActionComponentTreeObject) TreeObjectEvent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent) Cursor(org.eclipse.swt.graphics.Cursor) MobileRouteActionComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileRouteActionComponentTreeObject) Display(org.eclipse.swt.widgets.Display)

Example 24 with DatabaseObjectTreeObject

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

the class CreatePropertyTableRowAction 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) {
            PropertyTableTreeObject propertyTableTreeObject = (PropertyTableTreeObject) explorerView.getFirstSelectedTreeObject();
            TreeParent owner = propertyTableTreeObject.getTreeObjectOwner();
            IPropertyTreeObject pto = propertyTableTreeObject.addNewRow();
            if (owner instanceof DatabaseObjectTreeObject) {
                DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject) owner;
                if (databaseObjectTreeObject.hasChanged()) {
                    TreeParent treeParent = databaseObjectTreeObject.getParent();
                    if (treeParent instanceof FolderTreeObject)
                        treeParent = treeParent.getParent();
                    // explorerView.reloadTreeObject(treeParent);
                    explorerView.objectChanged(new CompositeEvent(treeParent.getObject(), pto.getPath()));
                }
            } else
                explorerView.refreshTreeObject(owner, true);
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create a new row!");
    } 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) TreeParent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent) Cursor(org.eclipse.swt.graphics.Cursor) FolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.FolderTreeObject) CompositeEvent(com.twinsoft.convertigo.eclipse.editors.CompositeEvent) PropertyTableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableTreeObject) Display(org.eclipse.swt.widgets.Display) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject)

Example 25 with DatabaseObjectTreeObject

use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject 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)

Aggregations

DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)119 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)93 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)81 Shell (org.eclipse.swt.widgets.Shell)67 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)66 Cursor (org.eclipse.swt.graphics.Cursor)64 Display (org.eclipse.swt.widgets.Display)64 TreeParent (com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent)37 StepTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StepTreeObject)31 EngineException (com.twinsoft.convertigo.engine.EngineException)28 Sequence (com.twinsoft.convertigo.beans.core.Sequence)26 ObjectsFolderTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject)23 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)21 StepWithExpressions (com.twinsoft.convertigo.beans.core.StepWithExpressions)20 PropertyTableRowTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableRowTreeObject)20 Step (com.twinsoft.convertigo.beans.core.Step)19 TreeObjectEvent (com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent)18 PropertyTableTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableTreeObject)18 IPropertyTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject)17 ProjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject)17