Search in sources :

Example 11 with DefectPhase

use of net.sourceforge.processdash.log.defects.DefectPhase in project processdash by dtuma.

the class MorePhaseOptionsHandler method getNodeForSelectedPhase.

private DefaultMutableTreeNode getNodeForSelectedPhase() {
    if (lastSelectedPhase == null)
        return null;
    String phaseID = lastSelectedPhase.getTerminalPhaseID();
    TreeNode root = (TreeNode) phaseOptionsTree.getModel().getRoot();
    Enumeration<TreeNode> workflows = root.children();
    while (workflows.hasMoreElements()) {
        TreeNode oneWorkflow = workflows.nextElement();
        Enumeration<DefaultMutableTreeNode> phases = oneWorkflow.children();
        while (phases.hasMoreElements()) {
            DefaultMutableTreeNode phaseNode = phases.nextElement();
            DefectPhase onePhase = (DefectPhase) phaseNode.getUserObject();
            if (phaseID == null) {
                if (onePhase.phaseID == null && lastSelectedPhase.legacyPhase.equals(onePhase.legacyPhase))
                    return phaseNode;
            } else if (phaseID.equals(onePhase.phaseID)) {
                return phaseNode;
            }
        }
    }
    return null;
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) TreeNode(javax.swing.tree.TreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) DefectPhase(net.sourceforge.processdash.log.defects.DefectPhase)

Aggregations

DefectPhase (net.sourceforge.processdash.log.defects.DefectPhase)11 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 JComboBox (javax.swing.JComboBox)2 Phase (net.sourceforge.processdash.process.WorkflowInfo.Phase)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 JScrollPane (javax.swing.JScrollPane)1 JTree (javax.swing.JTree)1 TreeNode (javax.swing.tree.TreeNode)1 TreePath (javax.swing.tree.TreePath)1 Workflow (net.sourceforge.processdash.process.WorkflowInfo.Workflow)1 JOptionPaneClickHandler (net.sourceforge.processdash.ui.lib.JOptionPaneClickHandler)1