Search in sources :

Example 16 with InternalRibbonGroup

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;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 17 with InternalRibbonGroup

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;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 18 with InternalRibbonGroup

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;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 19 with InternalRibbonGroup

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);
    }
}
Also used : WindowComponentPattern(com.qcadoo.view.internal.components.window.WindowComponentPattern) InternalViewDefinition(com.qcadoo.view.internal.api.InternalViewDefinition) Node(org.w3c.dom.Node) SingleRibbonGroupPack(com.qcadoo.view.internal.ribbon.model.SingleRibbonGroupPack) ViewDefinitionParserNodeException(com.qcadoo.view.internal.xml.ViewDefinitionParserNodeException) RibbonGroupsPack(com.qcadoo.view.internal.ribbon.model.RibbonGroupsPack) ModuleException(com.qcadoo.plugin.api.ModuleException) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup) ViewDefinitionParserNodeException(com.qcadoo.view.internal.xml.ViewDefinitionParserNodeException) IOException(java.io.IOException) ModuleException(com.qcadoo.plugin.api.ModuleException) ViewDefinitionParserException(com.qcadoo.view.internal.xml.ViewDefinitionParserException)

Example 20 with InternalRibbonGroup

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;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Aggregations

InternalRibbonGroup (com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)20 RibbonGroupImpl (com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl)18 InternalRibbonActionItem (com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)4 RibbonActionItemImpl (com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl)2 RibbonGroupsPack (com.qcadoo.view.internal.ribbon.model.RibbonGroupsPack)2 ViewDefinitionParserNodeException (com.qcadoo.view.internal.xml.ViewDefinitionParserNodeException)2 Node (org.w3c.dom.Node)2 ModuleException (com.qcadoo.plugin.api.ModuleException)1 SecurityRole (com.qcadoo.security.api.SecurityRole)1 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)1 InternalViewDefinition (com.qcadoo.view.internal.api.InternalViewDefinition)1 WindowComponentPattern (com.qcadoo.view.internal.components.window.WindowComponentPattern)1 SingleRibbonGroupPack (com.qcadoo.view.internal.ribbon.model.SingleRibbonGroupPack)1 RibbonTemplateParameters (com.qcadoo.view.internal.ribbon.templates.RibbonTemplateParameters)1 RibbonTemplate (com.qcadoo.view.internal.ribbon.templates.model.RibbonTemplate)1 TemplateRibbonGroupsPack (com.qcadoo.view.internal.ribbon.templates.model.TemplateRibbonGroupsPack)1 ViewDefinitionParserException (com.qcadoo.view.internal.xml.ViewDefinitionParserException)1 IOException (java.io.IOException)1 Test (org.junit.Test)1 NodeList (org.w3c.dom.NodeList)1