Search in sources :

Example 21 with PropertyKey

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);
    }
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 22 with PropertyKey

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;
}
Also used : TreePath(javax.swing.tree.TreePath) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 23 with PropertyKey

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;
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 24 with PropertyKey

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;
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 25 with PropertyKey

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);
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Aggregations

PropertyKey (net.sourceforge.processdash.hier.PropertyKey)125 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)40 Prop (net.sourceforge.processdash.hier.Prop)16 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)10 SimpleData (net.sourceforge.processdash.data.SimpleData)7 ArrayList (java.util.ArrayList)6 Enumeration (java.util.Enumeration)6 IOException (java.io.IOException)5 Iterator (java.util.Iterator)5 StringTokenizer (java.util.StringTokenizer)5 TreePath (javax.swing.tree.TreePath)5 ListData (net.sourceforge.processdash.data.ListData)5 DefectLog (net.sourceforge.processdash.log.defects.DefectLog)5 List (java.util.List)4 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)4 HierarchyAlterer (net.sourceforge.processdash.hier.HierarchyAlterer)4 HierarchyAlterationException (net.sourceforge.processdash.hier.HierarchyAlterer.HierarchyAlterationException)4 DefectLogID (net.sourceforge.processdash.log.defects.DefectLogID)4 TinyCGIException (net.sourceforge.processdash.net.http.TinyCGIException)4 Point (java.awt.Point)3