Search in sources :

Example 1 with ProcessEditor

use of com.centurylink.mdw.plugin.designer.editors.ProcessEditor in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method exportAs.

public void exportAs(WorkflowElement selection) {
    WorkflowProcess processVersion = (WorkflowProcess) selection;
    open(processVersion);
    ProcessEditor procEd = (ProcessEditor) findOpenEditor(processVersion);
    ExportAsDialog saveImageDialog = new ExportAsDialog(getShell(), processVersion, procEd.getProcessCanvasWrapper().getFlowchartPage());
    saveImageDialog.open();
}
Also used : ExportAsDialog(com.centurylink.mdw.plugin.designer.dialogs.ExportAsDialog) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Example 2 with ProcessEditor

use of com.centurylink.mdw.plugin.designer.editors.ProcessEditor in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method open.

public boolean open(WorkflowElement element) {
    if (element instanceof WorkflowProcess) {
        WorkflowProcess processVersion = (WorkflowProcess) element;
        try {
            ProcessEditor processEditor = (ProcessEditor) getPage().openEditor(processVersion, "mdw.editors.process");
            showPropertiesView();
            processEditor.setFocus();
        } catch (PartInitException ex) {
            PluginMessages.uiError(getShell(), ex, "Open Process", processVersion.getProject());
        }
    } else if (element instanceof AutomatedTestCase && ((AutomatedTestCase) element).isLegacy()) {
        // open the old way instead of as workflow asset
        AutomatedTestCase testCase = (AutomatedTestCase) element;
        IFile file = testCase.getCommandsFile();
        IWorkbenchPage activePage = MdwPlugin.getActivePage();
        try {
            IDE.openEditor(activePage, file, true);
        } catch (PartInitException ex) {
            PluginMessages.uiError(ex, "Open Test Case", testCase.getProject());
        }
    } else if (element instanceof WorkflowAsset) {
        WorkflowAsset asset = (WorkflowAsset) element;
        asset.openFile(new NullProgressMonitor());
    } else if (element instanceof LegacyExpectedResults) {
        LegacyExpectedResults expectedResult = (LegacyExpectedResults) element;
        IFile file = expectedResult.getExpectedResult();
        IWorkbenchPage activePage = MdwPlugin.getActivePage();
        try {
            IDE.openEditor(activePage, file, true);
        } catch (PartInitException ex) {
            PluginMessages.uiError(ex, "Open Expected Result", expectedResult.getProject());
        }
    } else if (element instanceof com.centurylink.mdw.plugin.designer.model.File) {
        com.centurylink.mdw.plugin.designer.model.File file = (com.centurylink.mdw.plugin.designer.model.File) element;
        IFile workspaceFile = file.getWorkspaceFile();
        IWorkbenchPage activePage = MdwPlugin.getActivePage();
        try {
            IDE.openEditor(activePage, workspaceFile, true);
        } catch (PartInitException ex) {
            PluginMessages.uiError(ex, "Open File", file.getProject());
        }
    } else if (element instanceof ExternalEvent) {
        ExternalEvent event = (ExternalEvent) element;
        if (event.getProject().checkRequiredVersion(6, 0)) {
            IFile file = event.getProject().getAssetFolder().getFolder(event.getPackage().getName().replace('.', '/')).getFile(event.getName() + EVT_HANDLER_FILE_EXTENSION);
            IWorkbenchPage activePage = MdwPlugin.getActivePage();
            try {
                IDE.openEditor(activePage, file, true);
            } catch (PartInitException ex) {
                PluginMessages.uiError(ex, "Open File", event.getProject());
            }
        }
    } else {
        return false;
    }
    return true;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IFile(org.eclipse.core.resources.IFile) WorkflowAsset(com.centurylink.mdw.plugin.designer.model.WorkflowAsset) LegacyExpectedResults(com.centurylink.mdw.plugin.designer.model.LegacyExpectedResults) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ExternalEvent(com.centurylink.mdw.plugin.designer.model.ExternalEvent) PartInitException(org.eclipse.ui.PartInitException) AutomatedTestCase(com.centurylink.mdw.plugin.designer.model.AutomatedTestCase) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) IFile(org.eclipse.core.resources.IFile) File(java.io.File) JarFile(com.centurylink.mdw.plugin.designer.model.JarFile) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Example 3 with ProcessEditor

use of com.centurylink.mdw.plugin.designer.editors.ProcessEditor in project mdw-designer by CenturyLinkCloud.

the class ProcessVersionsSection method openProcess.

private void openProcess(WorkflowProcess processVersion) {
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try {
        ProcessEditor processEditor = (ProcessEditor) page.openEditor(processVersion, "mdw.editors.process");
        processEditor.setFocus();
    } catch (PartInitException ex) {
        PluginMessages.uiError(composite.getShell(), ex, "Open Process", processVersion.getProject());
    }
}
Also used : IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Example 4 with ProcessEditor

use of com.centurylink.mdw.plugin.designer.editors.ProcessEditor in project mdw-designer by CenturyLinkCloud.

the class TabbedPropertySheetPage method selectionChanged.

public void selectionChanged(IWorkbenchPart part, ISelection selection) {
    if (part instanceof ProcessEditor && selection.equals(currentSelection))
        return;
    if (selection instanceof WorkflowProcess && selection.equals(currentSelection)) {
        // fool super into thinking the selection changed
        WorkflowProcess throwaway = new WorkflowProcess((WorkflowProcess) selection);
        throwaway.setDummy(true);
        super.selectionChanged(part, throwaway);
    }
    this.currentSelection = selection;
    if (selection instanceof WorkflowProcess) {
        WorkflowProcess processVersion = (WorkflowProcess) selection;
        if (getSite().getPage().findEditor(processVersion) == null)
            processVersion.setReadOnly(true);
    }
    super.selectionChanged(part, selection);
}
Also used : WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Example 5 with ProcessEditor

use of com.centurylink.mdw.plugin.designer.editors.ProcessEditor in project mdw-designer by CenturyLinkCloud.

the class ProcessCanvasWrapper method saveProcessAs.

public void saveProcessAs() {
    ProcessSaveAsDialog newProcessDialog = new ProcessSaveAsDialog(getParent().getShell(), getProcess());
    if (newProcessDialog.open() != Dialog.OK)
        // cancelled
        return;
    String newName = newProcessDialog.getNewName();
    WorkflowPackage newPkg = getProject().getDefaultPackage();
    if (!StringHelper.isEmpty(newProcessDialog.getPackageName()))
        newPkg = getProject().getPackage(newProcessDialog.getPackageName());
    flowchartPage.getProcess().blankOutTaskLogicalId();
    flowchartPage.getProcess().save_temp_vars();
    getDesignerProxy().saveProcessAs(getProcess(), newPkg, newName);
    WorkflowProcess newProc = getProject().getProcess(newName);
    if (newProc != null) {
        // update the process explorer tree
        newProc.sync();
        newProc.addElementChangeListener(getProject());
        newProc.fireElementChangeEvent(ChangeType.ELEMENT_CREATE, newProc);
        // update the canvas editor
        openProcessDefinition(newProc);
        IWorkbenchPage page = MdwPlugin.getActivePage();
        if (page != null) {
            ProcessEditor processEditor = (ProcessEditor) page.findEditor(getProcess());
            if (processEditor != null)
                page.closeEditor(processEditor, false);
        }
    }
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) ProcessSaveAsDialog(com.centurylink.mdw.plugin.designer.dialogs.ProcessSaveAsDialog) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Aggregations

ProcessEditor (com.centurylink.mdw.plugin.designer.editors.ProcessEditor)10 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)8 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)6 PartInitException (org.eclipse.ui.PartInitException)6 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)2 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)2 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)2 IOException (java.io.IOException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 IFile (org.eclipse.core.resources.IFile)2 IEditorPart (org.eclipse.ui.IEditorPart)2 Node (com.centurylink.mdw.designer.display.Node)1 ProcessInstancePage (com.centurylink.mdw.designer.runtime.ProcessInstancePage)1 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)1 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)1 ExportAsDialog (com.centurylink.mdw.plugin.designer.dialogs.ExportAsDialog)1 MdwProgressMonitorDialog (com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog)1 ProcessSaveAsDialog (com.centurylink.mdw.plugin.designer.dialogs.ProcessSaveAsDialog)1 Activity (com.centurylink.mdw.plugin.designer.model.Activity)1 ActivityImpl (com.centurylink.mdw.plugin.designer.model.ActivityImpl)1