use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.
the class RibbonTemplates method createFormActivateAndDeactivateActionsTemplate.
private InternalRibbonGroup createFormActivateAndDeactivateActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(STATES, role);
ribbonGroup.addItem(createFormActivateAction(viewDefinition));
ribbonGroup.addItem(createFormDeactivateAction(viewDefinition));
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.
the class RibbonTemplates method createFormSaveCopyAndRemoveActionsTemplate.
private InternalRibbonGroup createFormSaveCopyAndRemoveActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(createFormSaveAction(viewDefinition));
ribbonGroup.addItem(createFormSaveAndBackAction(viewDefinition));
ribbonGroup.addItem(createFormSaveAndNewAction(viewDefinition));
ribbonGroup.addItem(createFormCopyAction(viewDefinition));
ribbonGroup.addItem(createFormCancelAction(viewDefinition));
ribbonGroup.addItem(createFormDeleteAction(viewDefinition));
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.
the class RibbonTemplates method createFormCopyAndSaveNewActionsTemplate.
private InternalRibbonGroup createFormCopyAndSaveNewActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
ribbonGroup.addItem(createFormSaveAndNewAction(viewDefinition));
ribbonGroup.addItem(createFormCopyAction(viewDefinition));
return ribbonGroup;
}
use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.
the class ViewRibbonModule method enable.
@Override
public void enable() {
addedGroups = new HashMap<WindowComponentPattern, RibbonGroupsPack>();
InternalViewDefinition viewDefinition = viewDefinitionService.getWithoutSession(viewExtension.getPluginName(), viewExtension.getViewName());
if (viewDefinition == null) {
throw new ModuleException(pluginIdentifier, "view", "reference to view which not exists");
}
try {
for (Node groupNode : viewDefinitionParser.geElementChildren(viewExtension.getExtesionNode())) {
try {
InternalRibbonGroup group = viewDefinitionParser.parseRibbonGroup(groupNode, viewDefinition);
group.setExtensionPluginIdentifier(pluginIdentifier);
RibbonGroupsPack groupsPack = new SingleRibbonGroupPack(group);
WindowComponentPattern window = viewDefinition.getRootWindow();
window.getRibbon().addGroupsPack(groupsPack);
addedGroups.put(window, groupsPack);
} catch (ViewDefinitionParserNodeException e) {
throw ViewDefinitionParserException.forFileAndNode(fileName, e);
}
}
} catch (Exception e) {
throw new ModuleException(pluginIdentifier, "view-ribbon-group", e);
}
}
use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.
the class TemplateRibbonGroupsPackTest method getInternalRibbonGroup.
private InternalRibbonGroup getInternalRibbonGroup(final String name, final String extensionPluginIdentifier, final List<RibbonActionItem> items) {
InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(name);
ribbonGroup.setExtensionPluginIdentifier(extensionPluginIdentifier);
if (items != null) {
for (RibbonActionItem item : items) {
ribbonGroup.addItem((InternalRibbonActionItem) item);
}
}
return ribbonGroup;
}
Aggregations