Package net.sourceforge.ganttproject

Examples of net.sourceforge.ganttproject.CustomPropertyDefinition


        String type = atts.getValue("valuetype");

        if (atts.getValue("type").equals("custom")) {
            CustomColumn cc;
            String valueStr = atts.getValue("defaultvalue");
              CustomPropertyDefinition stubDefinition = CustomPropertyManager.PropertyTypeEncoder.decodeTypeAndDefaultValue(type, valueStr);
            cc = new CustomColumn(name, stubDefinition.getType(), stubDefinition.getDefaultValue());
            cc.setId(id);

            myColumnStorage.addCustomColumn(cc);
        }
    }
View Full Code Here


    //CustomPropertyManager customPropsManager = project.getHumanResourceManager().getCustomPropertyManager();
    AttributesImpl attrs = new AttributesImpl();
    List properties = resource.getCustomProperties();
    for (int i=0; i<properties.size(); i++) {
      CustomProperty nextProperty = (CustomProperty) properties.get(i);
      CustomPropertyDefinition nextDefinition = nextProperty.getDefinition();
            if (nextProperty.getValue()!=null && !nextProperty.getValue().equals(nextDefinition.getDefaultValue())) {
          addAttribute("definition-id", nextDefinition.getID(), attrs);
          addAttribute("value", nextProperty.getValueAsString(), attrs);
          emptyElement("custom-property", attrs, handler);
            }
    }
  }
View Full Code Here

//    }
        final AttributesImpl attrs = new AttributesImpl();
        //startElement("custom-properties-definition", handler);
    for (int i=0; i<definitions.size(); i++) {
      //ResourceColumn nextField = (ResourceColumn) fields.next();
      CustomPropertyDefinition nextDefinition = (CustomPropertyDefinition) definitions.get(i);
      addAttribute("id", nextDefinition.getID(), attrs);
      addAttribute("name", nextDefinition.getName(), attrs);
      addAttribute("type", nextDefinition.getTypeAsString(), attrs);
      addAttribute("default-value", nextDefinition.getDefaultValueAsString(), attrs);
      emptyElement("custom-property-definition", attrs, handler);
    }
    //endElement("custom-properties-definition", handler);
  }
View Full Code Here

    private void loadCustomProperty(Attributes attrs) {
      String id = attrs.getValue("definition-id");
      String value = attrs.getValue("value");
      List definitions = myCustomPropertyManager.getDefinitions();
      for (int i=0; i<definitions.size(); i++) {
        CustomPropertyDefinition nextDefinition = (CustomPropertyDefinition) definitions.get(i);
        if (id.equals(nextDefinition.getID())) {
          myCurrentResource.addCustomProperty(nextDefinition, value);
          break;
        }
      }
     
View Full Code Here

        if (csvOptions.bExportResourceRole) {
          writeCell(out, i18n("tableColResourceRole"));         
        }
        List customFieldDefs = myProject.getResourceCustomPropertyManager().getDefinitions();
        for (int i=0; i<customFieldDefs.size(); i++) {
          CustomPropertyDefinition nextDef = (CustomPropertyDefinition) customFieldDefs.get(i);
          writeCell(out, nextDef.getName());
        }
        out.write("\n\n");
    }
View Full Code Here

    }

    void initCustomProperties(){
      List/*<CustomPropertyDefinition>*/ defs = myManager.getCustomPropertyManager().getDefinitions();
      for (int i=0; i<defs.size(); i++) {
        CustomPropertyDefinition nextDefinition = (CustomPropertyDefinition) defs.get(i);
        customFields.put(nextDefinition.getName(), nextDefinition.getDefaultValue());
      }
    }
View Full Code Here

    List result = new ArrayList(customFields.size());
    for (Iterator entries = customFields.entrySet().iterator(); entries.hasNext();) {
      Map.Entry nextEntry = (Entry) entries.next();
      String nextName = (String) nextEntry.getKey();
      Object nextValue = nextEntry.getValue();
      CustomPropertyDefinition nextDefinition = myManager.getCustomPropertyDefinition(nextName);
      result.add(new CustomPropertyImpl(nextDefinition, nextValue));
    }
    return result;
  }
View Full Code Here

    }
    return result;
  }
 
  public CustomProperty addCustomProperty(CustomPropertyDefinition definition, String valueAsString) {
    final CustomPropertyDefinition stubDefinition = CustomPropertyManager.PropertyTypeEncoder.decodeTypeAndDefaultValue(definition.getTypeAsString(), valueAsString);
    addCustomField(definition.getName(), stubDefinition.getDefaultValue());
    return new CustomPropertyImpl(definition, stubDefinition.getDefaultValue());
  }
View Full Code Here

    }
    return result;
  }

  public CustomPropertyDefinition createDefinition(String id, String typeAsString, String name, String defaultValueAsString) {
    final CustomPropertyDefinition stubDefinition = CustomPropertyManager.PropertyTypeEncoder.decodeTypeAndDefaultValue(typeAsString, defaultValueAsString);
    CustomPropertyDefinition result = new CustomPropertyDefinitionImpl(name, id, stubDefinition);
    addCustomField(result);
    return result;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.CustomPropertyDefinition

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.