Search in sources :

Example 26 with Prop

use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.

the class DashController method getTemplates.

public static Map getTemplates() {
    Prop templates = dash.templates.pget(PropertyKey.ROOT);
    TreeMap result = new TreeMap();
    for (int i = templates.getNumChildren(); i-- > 0; ) {
        PropertyKey childKey = templates.getChild(i);
        Prop child = dash.templates.pget(childKey);
        result.put(child.getID(), Prop.unqualifiedName(childKey.name()));
    }
    return result;
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) TreeMap(java.util.TreeMap) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 27 with Prop

use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.

the class DashController method getDataAndDefectFilesInUse.

private static void getDataAndDefectFilesInUse(Set<String> filesInUse, PropertyKey node) {
    Prop p = dash.getHierarchy().pget(node);
    filesInUse.add(lower(p.getDataFile()));
    filesInUse.add(lower(p.getDefectLog()));
    for (int i = dash.getHierarchy().getNumChildren(node); i-- > 0; ) {
        PropertyKey child = dash.getHierarchy().getChildKey(node, i);
        getDataAndDefectFilesInUse(filesInUse, child);
    }
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 28 with Prop

use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.

the class MigrationToolIndivLauncher method assertNoMultiplePhases.

private void assertNoMultiplePhases(PropertyKey node) {
    Prop p = ctx.getHierarchy().pget(node);
    if (p.getNumChildren() == 0)
        return;
    String templateID = p.getID();
    if (templateID != null && templateID.startsWith("PSP"))
        return;
    List<String> phases = getPhaseChildren(node);
    int nonPhaseChildCount = p.getNumChildren() - phases.size();
    if (node == projectRoot) {
    // don't perform these tests for the root node - they aren't
    // applicable there.
    } else if (!phases.isEmpty() && nonPhaseChildCount > 0) {
        String message = getRes("Error.Hybrid_Node_FMT", esc(node.path()), enumeratePaths(node.path(), phases));
        failedPreconditions.add(message);
        showDeleteAdvice = true;
    } else if (phases.size() > 1) {
        String message = getRes("Error.Multiple_Phases_FMT", esc(node.path()), enumeratePaths(node.path(), phases));
        failedPreconditions.add(message);
        showDeleteAdvice = true;
    }
    for (int i = 0; i < p.getNumChildren(); i++) assertNoMultiplePhases(p.getChild(i));
}
Also used : Prop(net.sourceforge.processdash.hier.Prop)

Example 29 with Prop

use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.

the class MigrationToolTeam method getDataFileName.

private String getDataFileName(DashboardContext ctx, String path) {
    DashHierarchy hier = ctx.getHierarchy();
    PropertyKey key = hier.findExistingKey(path);
    if (key == null) {
        logger.severe("No property key found for '" + path + "'");
        return null;
    }
    Prop p = hier.pget(key);
    if (p == null) {
        logger.severe("No prop found for '" + path + "'");
        return null;
    }
    String dataFileName = p.getDataFile();
    if (dataFileName == null) {
        logger.severe("No datafile associated with '" + path + "'");
        return null;
    }
    return dataFileName;
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 30 with Prop

use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.

the class TemplateLoader method addScriptMaps.

private static void addScriptMaps(DashHierarchy templates, PropertyKey key, String ID, Vector v) {
    Prop val = (Prop) templates.get(key);
    if (val == null)
        return;
    if (Prop.hasValue(val.getID())) {
        ID = val.getID();
        v = (Vector) scriptMaps.get(ID);
        if (v == null)
            scriptMaps.put(ID, (v = new Vector()));
    }
    val.setScriptFile(processScriptFlag(v, val.getScriptFile()));
    for (int i = 0; i < val.getNumChildren(); i++) addScriptMaps(templates, val.getChild(i), ID, v);
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) Vector(java.util.Vector)

Aggregations

Prop (net.sourceforge.processdash.hier.Prop)30 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)16 Iterator (java.util.Iterator)4 StringTokenizer (java.util.StringTokenizer)4 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 Map (java.util.Map)3 Vector (java.util.Vector)3 Enumeration (java.util.Enumeration)2 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Hashtable (java.util.Hashtable)1 TreeMap (java.util.TreeMap)1 JMenu (javax.swing.JMenu)1 JMenuItem (javax.swing.JMenuItem)1 MutableTreeNode (javax.swing.tree.MutableTreeNode)1 TreeNode (javax.swing.tree.TreeNode)1 TreePath (javax.swing.tree.TreePath)1