use of org.openforis.collect.metamodel.CollectAnnotations.TextInput 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);
}
use of org.openforis.collect.metamodel.CollectAnnotations.TextInput 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);
}
Aggregations