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