Package org.geomajas.configuration

Examples of org.geomajas.configuration.AssociationAttributeInfo


            }
          } else {
            record.setAttribute(attributeInfo.getName(), "");
          }
        } else {
          AssociationAttributeInfo associationAttributeInfo = (AssociationAttributeInfo) attributeInfo;
          String displayName = associationAttributeInfo.getFeature().getDisplayAttributeName();
          if (displayName == null) {
            displayName = associationAttributeInfo.getFeature().getAttributes().get(0).getName();
          }
          switch (associationAttributeInfo.getType()) {
            case MANY_TO_ONE:
              ManyToOneAttribute manyToOneAttribute = (ManyToOneAttribute) attr;
              Object value = manyToOneAttribute.getValue().getAllAttributes().get(displayName).getValue();
              if (value != null) {
                record.setAttribute(attributeInfo.getName(), value.toString());
View Full Code Here


    Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
    for (AttributeInfo attrInfo : featureInfo.getAttributes()) {
      if (attrInfo instanceof PrimitiveAttributeInfo) {
        attributes.put(attrInfo.getName(), createPrimitiveAttribute((PrimitiveAttributeInfo) attrInfo));
      } else if (attrInfo instanceof AssociationAttributeInfo) {
        AssociationAttributeInfo assocInfo = (AssociationAttributeInfo) attrInfo;
        switch (assocInfo.getType()) {
          case MANY_TO_ONE:
            attributes.put(assocInfo.getName(), new ManyToOneAttribute());
            break;
          case ONE_TO_MANY:
            OneToManyAttribute oneToMany = new OneToManyAttribute();
            oneToMany.setValue(new ArrayList<AssociationValue>());
            attributes.put(assocInfo.getName(), oneToMany);
            break;

        }
      }
    }
View Full Code Here

      formItem.setValidateOnChange(true);
      formItem.setWidth("*");

      // Special treatment for associations
      if (info instanceof AssociationAttributeInfo) {
        AssociationAttributeInfo associationInfo = (AssociationAttributeInfo) info;
        String displayName = associationInfo.getFeature().getDisplayAttributeName();
        if (displayName == null) {
          displayName = associationInfo.getFeature().getAttributes().get(0).getName();
        }
        formItem.setDisplayField(displayName);
        Object o = formItem.getAttributeAsObject(AssociationItem.ASSOCIATION_ITEM_ATTRIBUTE_KEY);
        if (o instanceof OneToManyItem<?>) {
          OneToManyItem<?> item = (OneToManyItem<?>) o;
View Full Code Here

TOP

Related Classes of org.geomajas.configuration.AssociationAttributeInfo

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.