use of org.knime.workbench.editor2.WorkflowManagerInput in project knime-core by knime.
the class NodeContainerEditPart method openSubWorkflowEditor.
public void openSubWorkflowEditor() {
WorkflowCipherPrompt prompt = new GUIWorkflowCipherPrompt();
Object obj = getModel();
WorkflowManagerUI wm;
if (obj instanceof WorkflowManagerUI) {
wm = (WorkflowManagerUI) getModel();
} else if (obj instanceof SubNodeContainerUI) {
wm = ((SubNodeContainerUI) obj).getWorkflowManager();
} else {
return;
}
// if workflow manager is encrypted, try unlocking it
if (wm.isEncrypted()) {
if (!Wrapper.unwrapWFM(wm).unlock(prompt)) {
return;
}
}
// open new editor for subworkflow
LOGGER.debug("opening new editor for sub-workflow");
try {
final WorkflowEditor parent = (WorkflowEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
WorkflowManagerInput input = new WorkflowManagerInput(wm, parent);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, "org.knime.workbench.editor.WorkflowEditor");
} catch (PartInitException e) {
LOGGER.error("Error while opening new editor", e);
}
return;
}
Aggregations