use of org.openforis.collect.metamodel.ui.UIOptions 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 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 in project collect by openforis.
the class EntityDefinitionFormObject method saveTo.
@Override
public void saveTo(T dest, String languageCode) {
super.saveTo(dest, languageCode);
dest.setVirtual(virtual);
dest.setGeneratorExpression(virtual ? generatorExpression : null);
CollectSurvey survey = (CollectSurvey) dest.getSurvey();
dest.setEnumerate(survey.getTarget() == SurveyTarget.COLLECT_EARTH || enumerate);
UIOptions uiOptions = getUIOptions(dest);
Layout layout = Layout.valueOf(layoutType);
uiOptions.setLayout(dest, layout);
uiOptions.setCountInSummaryListValue(dest, countInRecordSummary);
uiOptions.setShowRowNumbersValue(dest, showRowNumbers);
Direction directionEnum = super.isMultiple() && layout == Layout.TABLE && Direction.BY_COLUMNS.getValue().equals(this.direction) ? Direction.BY_COLUMNS : null;
direction = directionEnum == null ? null : directionEnum.getValue();
uiOptions.setDirection(dest, directionEnum);
}
use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.
the class AttributeDefinitionFormObject method loadFrom.
@Override
public void loadFrom(T source, String languageCode) {
super.loadFrom(source, languageCode);
key = source.isKey();
attributeDefaults = new ArrayList<AttributeDefault>(source.getAttributeDefaults());
CollectSurvey survey = (CollectSurvey) source.getSurvey();
CollectAnnotations annotations = survey.getAnnotations();
phaseToApplyDefaultValue = annotations.getPhaseToApplyDefaultValue(source).name();
editable = annotations.isEditable(source);
measurement = annotations.isMeasurementAttribute(source);
showInMapBalloon = annotations.isShowInMapBalloon(source);
checks = new ArrayList<Check<?>>(source.getChecks());
UIOptions uiOptions = getUIOptions(source);
visibleFields = uiOptions.getVisibleFields(source);
if (source.getReferencedAttribute() != null) {
referencedAttributePath = source.getReferencedAttribute().getPath();
}
}
use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.
the class EntityDefinitionProxy method getDirection.
@ExternalizedProperty
public Direction getDirection() {
CollectSurvey survey = (CollectSurvey) entityDefinition.getSurvey();
UIOptions uiOpts = survey.getUIOptions();
Direction result = uiOpts.getDirection(entityDefinition);
return result;
}
Aggregations