Search in sources :

Example 6 with AttributeType

use of org.openforis.collect.designer.metamodel.AttributeType in project collect by openforis.

the class UIFieldView method getAttributeType.

public String getAttributeType() {
    AttributeDefinition attrDef = uiObject.getAttributeDefinition();
    AttributeType attrType = AttributeType.valueOf(attrDef);
    return attrType.name();
}
Also used : AttributeType(org.openforis.collect.designer.metamodel.AttributeType) AttributeDefinition(org.openforis.idm.metamodel.AttributeDefinition)

Example 7 with AttributeType

use of org.openforis.collect.designer.metamodel.AttributeType in project collect by openforis.

the class UIColumnView method getAttributeType.

public String getAttributeType() {
    AttributeDefinition attrDef = uiObject.getAttributeDefinition();
    AttributeType attrType = AttributeType.valueOf(attrDef);
    return attrType.name();
}
Also used : AttributeType(org.openforis.collect.designer.metamodel.AttributeType) AttributeDefinition(org.openforis.idm.metamodel.AttributeDefinition)

Example 8 with AttributeType

use of org.openforis.collect.designer.metamodel.AttributeType in project collect by openforis.

the class SchemaVM method getIcon.

public static String getIcon(SchemaNodeData data, boolean key, boolean calculated) {
    SurveyObject surveyObject = data.getSurveyObject();
    String imagesRootPath = NODE_TYPES_IMAGES_PATH;
    if (surveyObject instanceof UITab) {
        return imagesRootPath + "tab-small.png";
    } else if (surveyObject instanceof EntityDefinition) {
        return getEntityIcon((EntityDefinition) surveyObject);
    } else if (key) {
        return imagesRootPath + "key-small.png";
    } else if (calculated) {
        return imagesRootPath + "calculated-small.png";
    } else {
        AttributeType attributeType = AttributeType.valueOf((AttributeDefinition) surveyObject);
        return getAttributeIcon(attributeType.name());
    }
}
Also used : UITab(org.openforis.collect.metamodel.ui.UITab) EntityDefinition(org.openforis.idm.metamodel.EntityDefinition) SurveyObject(org.openforis.idm.metamodel.SurveyObject) AttributeType(org.openforis.collect.designer.metamodel.AttributeType) KeyAttributeDefinition(org.openforis.idm.metamodel.KeyAttributeDefinition) AttributeDefinition(org.openforis.idm.metamodel.AttributeDefinition)

Example 9 with AttributeType

use of org.openforis.collect.designer.metamodel.AttributeType in project collect by openforis.

the class AttributeConversionVM method getAttributeTypes.

public List<String> getAttributeTypes() {
    AttributeType currentType = AttributeType.valueOf(attributeDefinition);
    AttributeType[] types = AttributeType.values();
    List<String> typeLabels = new ArrayList<String>(types.length);
    for (AttributeType type : types) {
        if (type != currentType) {
            typeLabels.add(type.getLabel());
        }
    }
    return typeLabels;
}
Also used : AttributeType(org.openforis.collect.designer.metamodel.AttributeType) ArrayList(java.util.ArrayList)

Example 10 with AttributeType

use of org.openforis.collect.designer.metamodel.AttributeType in project collect by openforis.

the class AttributeVM method createFormObject.

@SuppressWarnings("unchecked")
@Override
protected FormObject<T> createFormObject() {
    AttributeType attributeTypeEnum = AttributeType.valueOf(editedItem);
    formObject = (AttributeDefinitionFormObject<T>) NodeDefinitionFormObject.newInstance(parentEntity, attributeTypeEnum);
    return formObject;
}
Also used : AttributeType(org.openforis.collect.designer.metamodel.AttributeType)

Aggregations

AttributeType (org.openforis.collect.designer.metamodel.AttributeType)10 AttributeDefinition (org.openforis.idm.metamodel.AttributeDefinition)6 ArrayList (java.util.ArrayList)3 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)3 UITab (org.openforis.collect.metamodel.ui.UITab)2 KeyAttributeDefinition (org.openforis.idm.metamodel.KeyAttributeDefinition)2 BooleanAttributeDefinition (org.openforis.idm.metamodel.BooleanAttributeDefinition)1 CoordinateAttributeDefinition (org.openforis.idm.metamodel.CoordinateAttributeDefinition)1 DateAttributeDefinition (org.openforis.idm.metamodel.DateAttributeDefinition)1 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)1 SurveyObject (org.openforis.idm.metamodel.SurveyObject)1 TextAttributeDefinition (org.openforis.idm.metamodel.TextAttributeDefinition)1 Command (org.zkoss.bind.annotation.Command)1 Textbox (org.zkoss.zul.Textbox)1 Window (org.zkoss.zul.Window)1