use of org.openforis.collect.metamodel.ui.UIOptions.CoordinateAttributeFieldsOrder in project collect by openforis.
the class CoordinateAttributeDefinitionFormObject method loadFieldsOrderValue.
protected void loadFieldsOrderValue(T source) {
CollectSurvey survey = (CollectSurvey) source.getSurvey();
UIOptions uiOptions = survey.getUIOptions();
CoordinateAttributeFieldsOrder fieldsOrder = uiOptions.getFieldsOrder(source);
fieldsOrderValue = fieldsOrder.name();
}
use of org.openforis.collect.metamodel.ui.UIOptions.CoordinateAttributeFieldsOrder in project collect by openforis.
the class CoordinateAttributeDefinitionFormObject method saveFieldOrderValue.
protected void saveFieldOrderValue(T dest) {
CollectSurvey survey = (CollectSurvey) dest.getSurvey();
UIOptions uiOptions = survey.getUIOptions();
CoordinateAttributeFieldsOrder fieldsOrder;
if (StringUtils.isBlank(fieldsOrderValue)) {
fieldsOrder = null;
} else {
fieldsOrder = CoordinateAttributeFieldsOrder.valueOf(fieldsOrderValue);
}
uiOptions.setFieldsOrder(dest, fieldsOrder);
}
use of org.openforis.collect.metamodel.ui.UIOptions.CoordinateAttributeFieldsOrder in project collect by openforis.
the class CoordinateAttributeVM method getFieldsOrderValues.
public String[] getFieldsOrderValues() {
CoordinateAttributeFieldsOrder[] values = CoordinateAttributeFieldsOrder.values();
String[] result = new String[values.length];
for (int i = 0; i < values.length; i++) {
CoordinateAttributeFieldsOrder fieldsOrder = values[i];
result[i] = fieldsOrder.name();
}
return result;
}
use of org.openforis.collect.metamodel.ui.UIOptions.CoordinateAttributeFieldsOrder in project collect by openforis.
the class CoordinateAttributeVM method getFieldsOrderLabel.
public String getFieldsOrderLabel(String value) {
CoordinateAttributeFieldsOrder enumValue = CoordinateAttributeFieldsOrder.valueOf(value);
String messageKey = "survey.schema.attribute.coordinate.fields_order." + enumValue.name().toLowerCase(Locale.ENGLISH);
return Labels.getLabel(messageKey);
}
use of org.openforis.collect.metamodel.ui.UIOptions.CoordinateAttributeFieldsOrder in project collect by openforis.
the class UIOptionsMigrator method createField.
protected UIField createField(UIFormContentContainer parent, NodeDefinition nodeDefn) {
CollectSurvey survey = (CollectSurvey) nodeDefn.getSurvey();
UIOptions uiOptions = survey.getUIOptions();
CollectAnnotations annotations = survey.getAnnotations();
UIField field;
if (nodeDefn instanceof CodeAttributeDefinition) {
UICodeField codeField = parent.createCodeField();
CodeAttributeDefinition codeAttrDefn = (CodeAttributeDefinition) nodeDefn;
codeField.setLayout(uiOptions.getLayoutType(codeAttrDefn));
codeField.setShowCode(uiOptions.getShowCode(codeAttrDefn));
codeField.setItemsOrientation(uiOptions.getLayoutDirection(codeAttrDefn));
field = codeField;
} else {
field = parent.createField();
}
field.setAttributeDefinitionId(nodeDefn.getId());
if (nodeDefn instanceof TextAttributeDefinition) {
String autoCompleteGroup = annotations.getAutoCompleteGroup((TextAttributeDefinition) nodeDefn);
field.setAutoCompleteGroup(autoCompleteGroup);
} else if (nodeDefn instanceof CoordinateAttributeDefinition) {
CoordinateAttributeFieldsOrder fieldsOrder = uiOptions.getFieldsOrder((CoordinateAttributeDefinition) nodeDefn);
field.setFieldsOrder(fieldsOrder);
}
field.setHidden(uiOptions.isHidden(nodeDefn));
return field;
}
Aggregations