use of com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess in project mdw-designer by CenturyLinkCloud.
the class ProcessHierarchyLabelProvider method getText.
public String getText(Object element) {
if (element instanceof LinkedProcessInstance) {
LinkedProcessInstance instance = (LinkedProcessInstance) element;
ProcessInstanceVO procInst = instance.getProcessInstance();
return procInst.getProcessName() + " v" + procInst.getProcessVersion() + " (" + procInst.getId() + ")";
} else if (element instanceof LinkedProcess) {
return ((LinkedProcess) element).getProcess().getLabel();
} else {
return null;
}
}
use of com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess in project mdw-designer by CenturyLinkCloud.
the class ProcessHierarchyView method createPartControl.
public void createPartControl(Composite parent) {
treeViewer = new TreeViewer(parent);
treeViewer.setLabelProvider(new ProcessHierarchyLabelProvider());
// action group
actionGroup = new ProcessHierarchyActionGroup(this);
actionGroup.fillActionBars(getViewSite().getActionBars());
treeViewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
for (Object item : getSelection().toList()) {
if (item instanceof LinkedProcess)
actionGroup.getActionHandler().open(((LinkedProcess) item).getProcess());
if (item instanceof LinkedProcessInstance) {
ProcessInstanceVO procInst = ((LinkedProcessInstance) item).getProcessInstance();
WorkflowProcess pv = processVersion.getProject().getProcess(procInst.getProcessId());
if (pv != null) {
WorkflowProcess toOpen = new WorkflowProcess(pv);
toOpen.setProcessInstance(procInst);
actionGroup.getActionHandler().open(toOpen);
}
}
}
}
});
}
Aggregations