Search in sources :

Example 1 with Direction

use of org.openforis.collect.metamodel.ui.UIOptions.Direction 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);
}
Also used : Layout(org.openforis.collect.metamodel.ui.UIOptions.Layout) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) Direction(org.openforis.collect.metamodel.ui.UIOptions.Direction)

Example 2 with Direction

use of org.openforis.collect.metamodel.ui.UIOptions.Direction 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;
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) Direction(org.openforis.collect.metamodel.ui.UIOptions.Direction) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Aggregations

UIOptions (org.openforis.collect.metamodel.ui.UIOptions)2 Direction (org.openforis.collect.metamodel.ui.UIOptions.Direction)2 CollectSurvey (org.openforis.collect.model.CollectSurvey)2 ExternalizedProperty (org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)1 Layout (org.openforis.collect.metamodel.ui.UIOptions.Layout)1