use of net.sourceforge.processdash.process.WorkflowInfo.Workflow in project processdash by dtuma.
the class MorePhaseOptionsHandler method buildTree.
private JTree buildTree() {
// build a tree model to contain the phase options.
DefaultMutableTreeNode root = new DefaultMutableTreeNode();
// Add all known workflows to the model.
for (Workflow workflow : workflowPhases.workflowInfo.getWorkflows()) {
DefaultMutableTreeNode workflowNode = new DefaultMutableTreeNode(workflow.getWorkflowName());
root.add(workflowNode);
for (Phase onePhase : workflow.getPhases()) {
DefectPhase dp = new DefectPhase(onePhase);
if (!"Postmortem".equals(dp.legacyPhase))
workflowNode.add(new DefaultMutableTreeNode(dp));
}
}
// Add MCF phases to the model.
if (processPhases != null && !processPhases.isEmpty()) {
String processName = processPhases.get(0).processName;
if (!StringUtils.hasValue(processName))
processName = resources.getString("More_Options.Process_Phases");
DefaultMutableTreeNode mcfNode = new DefaultMutableTreeNode(processName);
root.add(mcfNode);
for (DefectPhase onePhase : processPhases) mcfNode.add(new DefaultMutableTreeNode(onePhase));
}
// Create a JTree for this model.
JTree result = new JTree(root);
result.setRootVisible(false);
result.setShowsRootHandles(true);
result.setToggleClickCount(4);
result.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
result.setVisibleRowCount(10);
new JOptionPaneClickHandler().install(result);
return result;
}
Aggregations