use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class PropTreeModel method getNodeForKey.
public TreeNode getNodeForKey(DashHierarchy props, PropertyKey key) {
if (key == null)
return null;
if (rootKey.equals(key))
return (TreeNode) getRoot();
PropertyKey parentKey = key.getParent();
int numChildren = props.getNumChildren(parentKey);
TreeNode parent = getNodeForKey(props, parentKey);
if (parent == null || parent.getChildCount() != numChildren)
return null;
PropertyKey childKey;
for (int i = numChildren; i-- > 0; ) {
childKey = props.getChildKey(parentKey, i);
if (childKey.equals(key))
return parent.getChildAt(i);
}
return null;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class ScriptButton method updateAll.
private void updateAll() {
String clickPref = Settings.getVal(DROP_DOWN_BEHAVIOR_PREF);
clickOpensDefault = "true".equals(clickPref);
setMainButtonBehavior(clickOpensDefault ? RUN_FIRST_MENU_OPTION : OPEN_DROP_DOWN_MENU);
PropertyKey currentPhase = parent.getActiveTaskModel().getNode();
path = (currentPhase == null ? null : currentPhase.path());
setPaths(ScriptEnumerator.getScripts(parent, currentPhase));
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TemplateLoader method createProcessRoot.
/**
* The templates hierarchy needs a root. However, that root cannot
* be read from any file because its children are determined dynamically
* by searching classpaths and template directories. Once the children
* are loaded from their various locations, this routine dynamically
* builds their parent.
*
* NOTE: currently, the children are placed in alphabetical order.
*/
private static void createProcessRoot(DashHierarchy templates) {
Enumeration nodes = templates.keys();
Vector processes = new Vector();
PropertyKey key, parent;
while (nodes.hasMoreElements()) {
key = (PropertyKey) nodes.nextElement();
parent = key.getParent();
if (parent != null && parent.equals(PropertyKey.ROOT))
processes.add(key);
}
if (processes.size() > 0) {
Collections.sort(processes);
Prop p = new Prop();
while (processes.size() > 0) p.addChild((PropertyKey) processes.remove(0), -1);
templates.put(PropertyKey.ROOT, p);
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TemplateInfo method addSafeNamesOfProcessPhases.
public static final void addSafeNamesOfProcessPhases(HierarchyNodeMapper m) {
if (TEMPLATES == null)
// about the phases in various metrics collection frameworks.
return;
for (Iterator i = TEMPLATES.entrySet().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
PropertyKey key = (PropertyKey) e.getKey();
Prop prop = (Prop) e.getValue();
if (PROCESS_PHASE_STATUS.equals(prop.getStatus())) {
String phaseName = Prop.unqualifiedName(key.name());
m.addSafeName(phaseName);
}
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class OpenDefectDialog method openNewDefectDialog.
private void openNewDefectDialog(DefectLogID defectLog, String path) {
ProcessDashboard dash = getDash();
PropertyKey task = dash.getHierarchy().findClosestKey(path);
DefectDialog dlg = new DefectDialog(dash, defectLog.filename, defectLog.path, task);
if (!defectLog.path.equals(dash.getCurrentPhase()))
dlg.setTitle(defectLog.path.path());
}
Aggregations