Search in sources :

Example 1 with Type

use of org.openforis.idm.metamodel.TextAttributeDefinition.Type in project collect by openforis.

the class TextAttributeDefinitionFormObject method saveTo.

@Override
public void saveTo(T dest, String languageCode) {
    super.saveTo(dest, languageCode);
    Type typeEnum = TextAttributeDefinition.Type.valueOf(type);
    dest.setType(typeEnum);
    dest.setAnnotation(Annotation.AUTOCOMPLETE.getQName(), autocompleteGroup);
    UIOptions uiOptions = getUIOptions(dest);
    uiOptions.setAutoUppercase(dest, autoUppercase);
    CollectAnnotations annotations = ((CollectSurvey) dest.getSurvey()).getAnnotations();
    TextInput textInput = TextInput.valueOf(input);
    annotations.setTextInput(dest, textInput);
    annotations.setGeometry(dest, geometry);
}
Also used : Type(org.openforis.idm.metamodel.TextAttributeDefinition.Type) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey) TextInput(org.openforis.collect.metamodel.CollectAnnotations.TextInput)

Example 2 with Type

use of org.openforis.idm.metamodel.TextAttributeDefinition.Type in project collect by openforis.

the class TextAttributeDefinitionFormObject method loadFrom.

@Override
public void loadFrom(T source, String languageCode) {
    super.loadFrom(source, languageCode);
    Type typeEnum = source.getType();
    if (typeEnum == null) {
        typeEnum = Type.SHORT;
    }
    type = typeEnum.name();
    autocompleteGroup = source.getAnnotation(Annotation.AUTOCOMPLETE.getQName());
    UIOptions uiOptions = getUIOptions(source);
    autoUppercase = uiOptions.isAutoUppercase(source);
    CollectAnnotations annotations = ((CollectSurvey) source.getSurvey()).getAnnotations();
    TextInput textInput = annotations.getTextInput(source);
    input = textInput.name();
    geometry = annotations.isGeometry(source);
}
Also used : Type(org.openforis.idm.metamodel.TextAttributeDefinition.Type) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey) TextInput(org.openforis.collect.metamodel.CollectAnnotations.TextInput)

Aggregations

CollectAnnotations (org.openforis.collect.metamodel.CollectAnnotations)2 TextInput (org.openforis.collect.metamodel.CollectAnnotations.TextInput)2 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)2 CollectSurvey (org.openforis.collect.model.CollectSurvey)2 Type (org.openforis.idm.metamodel.TextAttributeDefinition.Type)2