Search in sources :

Example 16 with UIOptions

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

Example 17 with UIOptions

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

the class EditableListOfNodesVM method getChildDefinitionsInTab.

public List<NodeDefinition> getChildDefinitionsInTab(EntityDefinition entityDefn) {
    UIOptions uiOpts = getUIOptions();
    List<NodeDefinition> childDefinitions = entityDefn.getChildDefinitions();
    List<NodeDefinition> result = new ArrayList<NodeDefinition>();
    ModelVersion formVersion = getLayoutFormVersion();
    for (NodeDefinition nodeDefn : childDefinitions) {
        if (formVersion == null || formVersion.isApplicable(nodeDefn)) {
            UITab nodeTab = uiOpts.getAssignedTab(nodeDefn);
            if (nodeTab == tab) {
                result.add(nodeDefn);
            }
        }
    }
    return result;
}
Also used : UITab(org.openforis.collect.metamodel.ui.UITab) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) ArrayList(java.util.ArrayList) ModelVersion(org.openforis.idm.metamodel.ModelVersion)

Example 18 with UIOptions

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

the class EditableListOfNodesVM method getUIOptions.

protected UIOptions getUIOptions() {
    CollectSurvey survey = getSurvey();
    UIOptions uiOpts = survey.getUIOptions();
    return uiOpts;
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 19 with UIOptions

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

the class EditableListOfNodesVM method isTabInherited.

public boolean isTabInherited(NodeDefinition nodeDefn) {
    UIOptions uiOpts = getUIOptions();
    UITab tab = uiOpts.getAssignedTab(nodeDefn, false);
    return tab != null;
}
Also used : UITab(org.openforis.collect.metamodel.ui.UITab) UIOptions(org.openforis.collect.metamodel.ui.UIOptions)

Example 20 with UIOptions

use of org.openforis.collect.metamodel.ui.UIOptions 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);
}
Also used : Layout(org.openforis.collect.metamodel.ui.UIOptions.Layout) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) NotifyChange(org.zkoss.bind.annotation.NotifyChange) Command(org.zkoss.bind.annotation.Command) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand)

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