Search in sources :

Example 31 with UIOptions

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

Example 32 with UIOptions

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

Example 33 with UIOptions

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);
}
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 34 with UIOptions

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();
    }
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) AttributeDefault(org.openforis.idm.metamodel.AttributeDefault) Check(org.openforis.idm.metamodel.validation.Check) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 35 with UIOptions

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;
}
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)69 CollectSurvey (org.openforis.collect.model.CollectSurvey)38 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)22 UITab (org.openforis.collect.metamodel.ui.UITab)19 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)18 Layout (org.openforis.collect.metamodel.ui.UIOptions.Layout)10 ArrayList (java.util.ArrayList)9 CollectAnnotations (org.openforis.collect.metamodel.CollectAnnotations)9 UITabSet (org.openforis.collect.metamodel.ui.UITabSet)9 AttributeDefinition (org.openforis.idm.metamodel.AttributeDefinition)9 CodeAttributeDefinition (org.openforis.idm.metamodel.CodeAttributeDefinition)5 Schema (org.openforis.idm.metamodel.Schema)5 Command (org.zkoss.bind.annotation.Command)5 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)5 ExternalizedProperty (org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)4 SchemaNodeData (org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData)4 SchemaTreeNode (org.openforis.collect.designer.component.SchemaTreeModel.SchemaTreeNode)4 SurveyObjectsGenerator (org.openforis.collect.manager.SurveyObjectsGenerator)3 KeyAttributeDefinition (org.openforis.idm.metamodel.KeyAttributeDefinition)3 SurveyObject (org.openforis.idm.metamodel.SurveyObject)3