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);
}
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;
}
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;
}
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;
}
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);
}
Aggregations