use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TeamProjectBrowser method maybeCreateDefaultHierarchy.
private void maybeCreateDefaultHierarchy(DashHierarchy hier) {
if (hier.getNumChildren(PropertyKey.ROOT) == 0) {
PropertyKey projectNode = addHierChild(hier, PropertyKey.ROOT, resources.getString("Project"));
PropertyKey noneFound = addHierChild(hier, projectNode, resources.getString("None_Found"));
getOrCreateProp(hier, noneFound).setID(NO_PROJECT_TEMPLATE_ID);
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TeamProjectBrowser method getSelectedTreeNode.
private PropertyKey getSelectedTreeNode() {
PropertyKey selectedNode = null;
TreePath tp = tree.getSelectionPath();
if (tp != null) {
Object[] path = tp.getPath();
selectedNode = treeModel.getPropKey(treeProps, path);
}
if (selectedNode == null)
selectedNode = PropertyKey.ROOT;
return selectedNode;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TeamProjectBrowser method pruneForDisplay.
/**
* Recursively prune items so the leaves of the tree are all team project
* roots.
*
* @param hier
* the hierarchy to prune
* @param node
* one node to examine
* @return true if this node should be pruned from the tree, false otherwise
*/
private boolean pruneForDisplay(DashHierarchy hier, PropertyKey node) {
Prop p = hier.pget(node);
String templateId = p.getID();
boolean isProject = StringUtils.hasValue(templateId);
if (isProject && filter != null && !filter.shouldShow(node.path())) {
return true;
}
for (int i = p.getNumChildren(); i-- > 0; ) {
PropertyKey child = p.getChild(i);
boolean shouldPrune = isProject || pruneForDisplay(hier, child);
if (shouldPrune)
p.removeChild(i);
}
return isProject == false && p.getNumChildren() == 0;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TeamProjectBrowser method projectParentIsInvalid.
private boolean projectParentIsInvalid(String path) {
PropertyKey key = ctx.getHierarchy().findClosestKey(path);
while (key != null) {
String templateID = ctx.getHierarchy().getID(key);
if (StringUtils.hasValue(templateID))
return true;
key = key.getParent();
}
return false;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TeamProjectBrowser method initActiveTaskFromPreferences.
private void initActiveTaskFromPreferences() {
String activeTask = Settings.getVal(ACTIVE_TASK_SETTING);
PropertyKey key = ctx.getHierarchy().findExistingKey(activeTask);
if (key != null && ctx.getHierarchy().getNumChildren(key) == 0)
taskModel.setNode(key);
}
Aggregations