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();
}
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;
}
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());
}
}
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);
}
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);
}
}
}
Aggregations