Search in sources :

Example 76 with DatabaseObjectTreeObject

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

the class CreateListenerAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    try {
        boolean enable = true;
        super.selectionChanged(action, selection);
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
        if (treeObject instanceof ObjectsFolderTreeObject)
            enable = ((ObjectsFolderTreeObject) treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_LISTENERS;
        else if (treeObject instanceof DatabaseObjectTreeObject) {
            DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
            ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
            enable = actionModel.isEnabled;
        }
        action.setEnabled(enable);
    } catch (Exception e) {
    }
}
Also used : DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) ActionModel(com.twinsoft.convertigo.engine.studio.ActionModel)

Example 77 with DatabaseObjectTreeObject

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

the class CreateMobileApplicationComponentAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    try {
        boolean enable = false;
        super.selectionChanged(action, selection);
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
        if (treeObject instanceof DatabaseObjectTreeObject) {
            DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
            enable = dbo.getProject().getMobileBuilder().isIonicTemplateBased();
        }
        action.setEnabled(enable);
    } catch (Exception e) {
    }
}
Also used : DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 78 with DatabaseObjectTreeObject

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

the class CreateMobileRouteActionComponentAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    try {
        boolean enable = true;
        super.selectionChanged(action, selection);
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
        if (treeObject instanceof ObjectsFolderTreeObject) {
            ObjectsFolderTreeObject ofto = (ObjectsFolderTreeObject) treeObject;
            enable = ofto.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_ACTIONS;
            treeObject = ofto.getParent();
        }
        if (enable && treeObject instanceof DatabaseObjectTreeObject) {
            DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
            ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
            enable = actionModel.isEnabled;
        }
        action.setEnabled(enable);
    } catch (Exception e) {
    }
}
Also used : DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) ActionModel(com.twinsoft.convertigo.engine.studio.ActionModel)

Example 79 with DatabaseObjectTreeObject

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

the class CreateMobileUIComponentAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    try {
        boolean enable = true;
        super.selectionChanged(action, selection);
        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
        if (treeObject instanceof ObjectsFolderTreeObject) {
            ObjectsFolderTreeObject oft = (ObjectsFolderTreeObject) treeObject;
            if (oft.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_PAGES) {
                enable = false;
            } else {
                TreeParent treeParent = oft.getParent();
                enable = treeParent != null && treeParent instanceof MobileComponentTreeObject;
            }
        } else if (treeObject instanceof DatabaseObjectTreeObject) {
            DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
            ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
            enable = actionModel.isEnabled;
        }
        action.setEnabled(enable);
    } catch (Exception e) {
    }
}
Also used : DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) TreeParent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) MobileComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileComponentTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) MobileComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileComponentTreeObject) ActionModel(com.twinsoft.convertigo.engine.studio.ActionModel)

Example 80 with DatabaseObjectTreeObject

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

the class CreatePropertyTableColumnAction 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) {
            PropertyTableRowTreeObject propertyTableRowTreeObject = (PropertyTableRowTreeObject) explorerView.getFirstSelectedTreeObject();
            TreeParent owner = propertyTableRowTreeObject.getTreeObjectOwner();
            IPropertyTreeObject pto = propertyTableRowTreeObject.addNewColumn();
            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 column!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : PropertyTableRowTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableRowTreeObject) 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) Display(org.eclipse.swt.widgets.Display) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject)

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