use of org.openforis.collect.metamodel.ui.UIOptions.Layout in project collect by openforis.
the class EditableListOfNodesVM method hasLayout.
public boolean hasLayout(EntityDefinition entityDefn, String layout) {
UIOptions uiOpts = getUIOptions();
Layout nodeLayout = uiOpts.getLayout(entityDefn);
return nodeLayout.name().equals(layout);
}
use of org.openforis.collect.metamodel.ui.UIOptions.Layout in project collect by openforis.
the class EditableListOfNodesVM method setLayout.
@Command
@NotifyChange({ "nodesPerTab" })
public void setLayout(@BindingParam("type") String type, @BindingParam("node") EntityDefinition node) {
UIOptions uiOpts = getUIOptions();
Layout layout = Layout.valueOf(type);
uiOpts.setLayout(node, layout);
}
use of org.openforis.collect.metamodel.ui.UIOptions.Layout 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.Layout in project collect by openforis.
the class EntityDefinitionProxy method getLayout.
@ExternalizedProperty
public String getLayout() {
CollectSurvey survey = (CollectSurvey) entityDefinition.getSurvey();
UIOptions uiOpts = survey.getUIOptions();
Layout layout = uiOpts.getLayout(entityDefinition);
return layout.name().toLowerCase(Locale.ENGLISH);
}
use of org.openforis.collect.metamodel.ui.UIOptions.Layout in project collect by openforis.
the class EntityDefinitionFormObject method loadFrom.
@Override
public void loadFrom(T source, String languageCode) {
super.loadFrom(source, languageCode);
virtual = source.isVirtual();
generatorExpression = source.getGeneratorExpression();
enumerate = source.isEnumerate();
UIOptions uiOptions = getUIOptions(source);
Layout layout = uiOptions.getLayout(source);
layoutType = layout.name();
countInRecordSummary = uiOptions.getCountInSumamryListValue(source);
showRowNumbers = uiOptions.getShowRowNumbersValue(source);
direction = uiOptions.getDirection(source).getValue();
}
Aggregations