use of com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl in project qcadoo by qcadoo.
the class RibbonParserService method parseRibbonGroup.
public InternalRibbonGroup parseRibbonGroup(final Node groupNode, final ViewDefinitionParser parser, final ViewDefinition viewDefinition) throws ViewDefinitionParserNodeException {
String template = parser.getStringAttribute(groupNode, "template");
SecurityRole role = parser.getAuthorizationRole(groupNode);
if (template == null) {
String groupName = parser.getStringAttribute(groupNode, NAME);
if (groupName == null) {
throw new ViewDefinitionParserNodeException(groupNode, "Name attribute cannot be empty");
}
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(groupName, role);
NodeList childNodes = groupNode.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
if (child.getNodeType() == Node.ELEMENT_NODE) {
ribbonGroup.addItem(parseRibbonItem(child, parser, viewDefinition));
}
}
return ribbonGroup;
} else {
try {
return ribbonTemplates.getGroupTemplate(template, viewDefinition, role);
} catch (IllegalStateException e) {
throw new ViewDefinitionParserNodeException(groupNode, e);
}
}
}
use of com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl in project qcadoo by qcadoo.
the class RibbonTemplates method createGridNewActionTemplate.
private InternalRibbonGroup createGridNewActionTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(createGridNewAction(viewDefinition));
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl in project qcadoo by qcadoo.
the class RibbonTemplates method createGridNewAndCopyActionsTemplate.
private InternalRibbonGroup createGridNewAndCopyActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(createGridNewAction(viewDefinition));
ribbonGroup.addItem(createGridCopyAction(viewDefinition));
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl in project qcadoo by qcadoo.
the class RibbonTemplates method createFormSaveActionTemplate.
private InternalRibbonGroup createFormSaveActionTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonActionItem ribbonSaveAction = new RibbonActionItemImpl();
ribbonSaveAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performSave; #{window}.performBack", viewDefinition));
ribbonSaveAction.setIcon("saveBackIcon24.png");
ribbonSaveAction.setName("saveBack");
ribbonSaveAction.setType(RibbonActionItem.Type.BIG_BUTTON);
ribbonSaveAction.setEnabled(true);
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(ribbonSaveAction);
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl in project qcadoo by qcadoo.
the class RibbonTemplates method createGridNewCopyAndRemoveActionsTemplate.
private InternalRibbonGroup createGridNewCopyAndRemoveActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(createGridNewAction(viewDefinition));
ribbonGroup.addItem(createGridCopyAction(viewDefinition));
ribbonGroup.addItem(createGridDeleteAction(viewDefinition));
return ribbonGroup;
}
Aggregations