Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.SimpleData


  private String getDataNamespace() {
      if (dataNamespace == null) {
          String dataName = DataRepository.createDataName(dataPrefix,
                  "Defect_Data_Namespace");
          SimpleData sd = data.getSimpleValue(dataName);
          if (sd == null)
              dataNamespace = "";
          else
              dataNamespace = sd.format() + "/";
      }
      return dataNamespace;
  }
View Full Code Here


        if (id == null || id.length() == 0)
            return;
       
        String dataName = DataRepository.createDataName(taskPath,
                TASK_ID_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        ListData newValue;
        if (currentValue instanceof ListData)
            newValue = (ListData) currentValue;
        else if (currentValue instanceof StringData)
            newValue = ((StringData) currentValue).asList();
View Full Code Here

    }

    public static void removeTaskID(DataContext data, String taskPath, String id) {
        String dataName = DataRepository.createDataName(taskPath,
                TASK_ID_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        ListData list = null;
       
        if (currentValue instanceof ListData)
            list = (ListData) currentValue;
        else if (currentValue instanceof StringData)
View Full Code Here

    }
   
    public static List getTaskIDs(DataContext data, String taskPath) {
        String dataName = DataRepository.createDataName(taskPath,
                TASK_ID_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        ListData list = null;
       
        if (currentValue == null || currentValue.test() == false)
            return null;
        if (currentValue instanceof ListData)
            list = (ListData) currentValue;
        else if (currentValue instanceof StringData)
            list = ((StringData) currentValue).asList();
View Full Code Here

    public static List<EVTaskDependency> getDependencies(DataContext data,
            String taskPath) {
        String dataName = DataRepository.createDataName(taskPath,
                TASK_DEPENDENCIES_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        if (currentValue == null || !currentValue.test())
            return null;

        List<EVTaskDependency> result = new LinkedList<EVTaskDependency>();
        try {
            Element e = XMLUtils.parse(currentValue.format())
                    .getDocumentElement();
            NodeList nl = e.getElementsByTagName(DEPENDENCY_TAG);
            for (int i = 0; i < nl.getLength(); i++) {
                result.add(new EVTaskDependency((Element) nl.item(i)));
            }
View Full Code Here

        return result;
    }

    public static void saveDependencies(DataContext data, String taskPath,
            Collection<EVTaskDependency> dependencies) {
        SimpleData value = null;
       
        if (dependencies != null && !dependencies.isEmpty()) {
            StringBuffer xml = new StringBuffer();
            xml.append("<list>");
            for (EVTaskDependency d : dependencies) {
View Full Code Here

    }
    public void hierarchyChanged(Event e) {
        updatePSPDataAnalysisVisibility();
    }
    public void updatePSPDataAnalysisVisibility() {
        SimpleData sd = parent.getData().getSimpleValue("/PSP/Project List");
        boolean hasPspTasks = (sd != null && sd.test());
        menuItem.setVisible(hasPspTasks);
    }
View Full Code Here

    }
   
    private AbstractInstruction getExportInstructionFromData(String name) {
        if (!name.endsWith("/"+EXPORT_DATANAME))
            return null;
        SimpleData dataVal = data.getSimpleValue(name);
        if (dataVal == null || !dataVal.test())
            return null;
        String filename = Settings.translateFile(dataVal.format());

        String path = name.substring(0,
                name.length() - EXPORT_DATANAME.length() - 1);
        Vector filter = new Vector();
        filter.add(path);

        ExportMetricsFileInstruction instr = new ExportMetricsFileInstruction(
                filename, filter);
        instr.setAttribute(DATANAME_ATTR, name);
       
        String instrDataname = name + EXPORT_INSTRUCTIONS_SUFFIX;
        SimpleData instrVal = data.getSimpleValue(instrDataname);
        if (instrVal != null && instrVal.test())
            addXmlDataToInstruction(instr, instrVal.format());
       
        String disableDataname = name + EXPORT_DISABLED_SUFFIX;
        SimpleData disableVal = data.getSimpleValue(disableDataname);
        if (disableVal != null && disableVal.test())
            instr.setEnabled(false);

        String urlDataname = name + EXPORT_URL_SUFFIX;
        SimpleData urlVal = data.getSimpleValue(urlDataname);
        if (urlVal != null && urlVal.test())
            instr.setServerUrl(urlVal.format());

        return instr;
    }
View Full Code Here

            // don't change the estimates of PSP tasks whose Planning phase
            // has been marked complete (because associated values are frozen)
            return false;

        // Check the estimate in question to see if it is read-only
        SimpleData sd = getValue(path, ESTIMATED_TIME, false);
        return (sd == null || sd.isEditable());
    }
View Full Code Here

            DataRepository.createDataName(prefix, ESTIMATED_TIME),
            new DoubleData(value, true));
    }

    private double getNum(String prefix, String dataName) {
        SimpleData sd = getValue(prefix, dataName, false);
        return (sd instanceof DoubleData ? ((DoubleData) sd).getDouble() : 0);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.data.SimpleData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.