Search in sources :

Example 6 with NgxPageComponentTreeObject

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

the class SetNgxRootPageAction 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) {
            NgxPageComponentTreeObject pageTreeObject = (NgxPageComponentTreeObject) explorerView.getFirstSelectedTreeObject();
            PageComponent page = (PageComponent) pageTreeObject.getObject();
            ApplicationComponent application = (ApplicationComponent) page.getParent();
            NgxPageComponentTreeObject rootPageTreeObject = null;
            PageComponent rootPage = application.getRootPage();
            if (rootPage != null) {
                rootPageTreeObject = (NgxPageComponentTreeObject) explorerView.findTreeObjectByUserObject(rootPage);
            }
            application.setRootPage(page);
            application.markRootAsDirty();
            if (rootPageTreeObject != null) {
                rootPageTreeObject.isDefault = false;
                rootPageTreeObject.hasBeenModified(true);
            }
            pageTreeObject.isDefault = true;
            pageTreeObject.hasBeenModified(true);
            // Updating the tree
            explorerView.refreshTreeObject(pageTreeObject.getParentDatabaseObjectTreeObject());
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to set page to root one!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) Cursor(org.eclipse.swt.graphics.Cursor) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent) Display(org.eclipse.swt.widgets.Display)

Example 7 with NgxPageComponentTreeObject

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

the class SetNgxRootPageAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    super.selectionChanged(action, selection);
    IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
    if (treeObject instanceof NgxPageComponentTreeObject) {
        DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
        ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
        action.setChecked(actionModel.isChecked);
    }
}
Also used : NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ActionModel(com.twinsoft.convertigo.engine.studio.ActionModel)

Example 8 with NgxPageComponentTreeObject

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

the class DisableNgxPageComponentAction method selectionChanged.

public void selectionChanged(IAction action, ISelection selection) {
    super.selectionChanged(action, selection);
    IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
    if (treeObject instanceof NgxPageComponentTreeObject) {
        DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
        ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
        action.setEnabled(actionModel.isEnabled);
    }
}
Also used : NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) 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) ActionModel(com.twinsoft.convertigo.engine.studio.ActionModel)

Example 9 with NgxPageComponentTreeObject

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

the class DisableNgxPageComponentAction 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 NgxPageComponentTreeObject) {
                    NgxPageComponentTreeObject componentTreeObject = GenericUtils.cast(treeObject);
                    component = (PageComponent) 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 page!");
    } 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) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) 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.ngx.components.PageComponent) Display(org.eclipse.swt.widgets.Display)

Example 10 with NgxPageComponentTreeObject

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

the class EditNgxComponentClassAction 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) {
            TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
            if (treeObject instanceof NgxComponentTreeObject) {
                if (treeObject instanceof NgxApplicationComponentTreeObject) {
                    NgxApplicationComponentTreeObject mpcto = GenericUtils.cast(treeObject);
                    mpcto.editAppComponentTsFile();
                } else if (treeObject instanceof NgxPageComponentTreeObject) {
                    NgxPageComponentTreeObject mpcto = GenericUtils.cast(treeObject);
                    mpcto.editPageTsFile();
                } else if (treeObject instanceof NgxUIComponentTreeObject) {
                    NgxUIComponentTreeObject mpcto = GenericUtils.cast(treeObject);
                    mpcto.editCompTsFile();
                }
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to edit ngx component class!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : NgxUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject) Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) NgxComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxComponentTreeObject) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) NgxPageComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject) NgxUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) NgxComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxComponentTreeObject) NgxApplicationComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxApplicationComponentTreeObject) Cursor(org.eclipse.swt.graphics.Cursor) NgxApplicationComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxApplicationComponentTreeObject) Display(org.eclipse.swt.widgets.Display)

Aggregations

NgxPageComponentTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxPageComponentTreeObject)10 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)8 DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)6 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)5 NgxUIComponentTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject)4 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)3 NgxApplicationComponentTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxApplicationComponentTreeObject)3 Cursor (org.eclipse.swt.graphics.Cursor)3 Display (org.eclipse.swt.widgets.Display)3 Shell (org.eclipse.swt.widgets.Shell)3 PageComponent (com.twinsoft.convertigo.beans.ngx.components.PageComponent)2 HandlerStatement (com.twinsoft.convertigo.beans.statements.HandlerStatement)2 RequestableVariable (com.twinsoft.convertigo.beans.variables.RequestableVariable)2 TreeDragListener (com.twinsoft.convertigo.eclipse.dnd.TreeDragListener)2 CompositeListener (com.twinsoft.convertigo.eclipse.editors.CompositeListener)2 ConnectorTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ConnectorTreeObject)2 CriteriaTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.CriteriaTreeObject)2 DesignDocumentFilterTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DesignDocumentFilterTreeObject)2 DesignDocumentFunctionTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DesignDocumentFunctionTreeObject)2 DesignDocumentTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DesignDocumentTreeObject)2