Search in sources :

Example 1 with LinkedProcess

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;
    }
}
Also used : LinkedProcess(com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess) LinkedProcessInstance(com.centurylink.mdw.model.value.process.LinkedProcessInstance) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO)

Example 2 with LinkedProcess

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);
                    }
                }
            }
        }
    });
}
Also used : IOpenListener(org.eclipse.jface.viewers.IOpenListener) LinkedProcess(com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess) TreeViewer(org.eclipse.jface.viewers.TreeViewer) LinkedProcessInstance(com.centurylink.mdw.model.value.process.LinkedProcessInstance) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Aggregations

LinkedProcessInstance (com.centurylink.mdw.model.value.process.LinkedProcessInstance)2 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)2 LinkedProcess (com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess)2 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 IOpenListener (org.eclipse.jface.viewers.IOpenListener)1 OpenEvent (org.eclipse.jface.viewers.OpenEvent)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1