Search in sources :

Example 1 with TaskTemplateEditor

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

the class WorkflowAssetEditor method openWorkflowAsset.

private void openWorkflowAsset() {
    if (workflowAsset instanceof WorkflowProcess) {
        IWorkbenchPage page = MdwPlugin.getActivePage();
        WorkflowProcess proc = (WorkflowProcess) workflowAsset;
        try {
            page.openEditor(proc, "mdw.editors.process");
        } catch (PartInitException ex) {
            PluginMessages.uiError(MdwPlugin.getShell(), ex, "Open Process", getProject());
        }
    } else if (workflowAsset instanceof TaskTemplate) {
        IWorkbenchPage page = MdwPlugin.getActivePage();
        TaskTemplate taskTemplate = (TaskTemplate) workflowAsset;
        try {
            FileEditorInput editorInput = new FileEditorInput(taskTemplate.getAssetFile());
            TaskTemplateEditor editor = (TaskTemplateEditor) page.openEditor(editorInput, "mdw.editors.taskTemplate");
            editor.setProcess(getProcess());
        } catch (PartInitException ex) {
            PluginMessages.uiError(MdwPlugin.getShell(), ex, "Open Process", getProject());
        }
    } else {
        ((WorkflowAsset) workflowAsset).openFile(new NullProgressMonitor());
    }
}
Also used : TaskTemplate(com.centurylink.mdw.plugin.designer.model.TaskTemplate) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) TaskTemplateEditor(com.centurylink.mdw.plugin.designer.editors.TaskTemplateEditor) FileEditorInput(org.eclipse.ui.part.FileEditorInput) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Aggregations

TaskTemplateEditor (com.centurylink.mdw.plugin.designer.editors.TaskTemplateEditor)1 TaskTemplate (com.centurylink.mdw.plugin.designer.model.TaskTemplate)1 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 PartInitException (org.eclipse.ui.PartInitException)1 FileEditorInput (org.eclipse.ui.part.FileEditorInput)1