Search in sources :

Example 46 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.

the class CoordinateAttributeDefinitionProxy method getFieldsOrder.

@ExternalizedProperty
public CoordinateAttributeFieldsOrder getFieldsOrder() {
    CollectSurvey survey = (CollectSurvey) nodeDefinition.getSurvey();
    UIOptions uiOptions = survey.getUIOptions();
    return uiOptions.getFieldsOrder((CoordinateAttributeDefinition) nodeDefinition);
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 47 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.

the class SchemaVM method isTableEntity.

public boolean isTableEntity(SchemaNodeData data) {
    if (isEntity(data)) {
        UIOptions uiOptions = survey.getUIOptions();
        EntityDefinition entityDefn = (EntityDefinition) data.getSurveyObject();
        Layout layout = uiOptions.getLayout(entityDefn);
        return layout == Layout.TABLE;
    } else {
        return false;
    }
}
Also used : EntityDefinition(org.openforis.idm.metamodel.EntityDefinition) Layout(org.openforis.collect.metamodel.ui.UIOptions.Layout) UIOptions(org.openforis.collect.metamodel.ui.UIOptions)

Example 48 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.

the class SchemaVM method removeTab.

private void removeTab(final UITab tab) {
    String confirmMessageKey = null;
    if (tab.getTabs().isEmpty()) {
        CollectSurvey survey = getSurvey();
        UIOptions uiOpts = survey.getUIOptions();
        List<NodeDefinition> nodesPerTab = uiOpts.getNodesPerTab(tab, false);
        if (!nodesPerTab.isEmpty()) {
            confirmMessageKey = "survey.layout.tab.remove.confirm.associated_nodes_present";
        }
    } else {
        confirmMessageKey = "survey.layout.tab.remove.confirm.nested_tabs_present";
    }
    if (confirmMessageKey != null) {
        MessageUtil.ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {

            @Override
            public void onOk() {
                performRemoveTab(tab);
            }
        }, confirmMessageKey);
        params.setOkLabelKey("global.delete_item");
        MessageUtil.showConfirm(params);
    } else {
        performRemoveTab(tab);
    }
}
Also used : MessageUtil(org.openforis.collect.designer.util.MessageUtil) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 49 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.

the class SchemaVM method associateNodeToTab.

private void associateNodeToTab(NodeDefinition node, UITab tab) {
    UIOptions uiOptions = survey.getUIOptions();
    uiOptions.assignToTab(node, tab);
    refreshTreeModel();
    selectTreeNode(node);
    treeModel.showSelectedNode();
    notifyChange("selectedTreeNode", "editedNode");
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions)

Example 50 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions in project collect by openforis.

the class SchemaVM method getEntityIcon.

protected static String getEntityIcon(EntityDefinition entityDefn) {
    CollectSurvey survey = (CollectSurvey) entityDefn.getSurvey();
    UIOptions uiOptions = survey.getUIOptions();
    Layout layout = uiOptions.getLayout(entityDefn);
    String icon;
    if (entityDefn.isMultiple()) {
        switch(layout) {
            case TABLE:
                icon = "table-small.png";
                break;
            case FORM:
            default:
                icon = "form-small.png";
        }
    } else {
        icon = "grouping-small.png";
    }
    return NODE_TYPES_IMAGES_PATH + icon;
}
Also used : Layout(org.openforis.collect.metamodel.ui.UIOptions.Layout) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey)

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