Search in sources :

Example 6 with InternalRibbonGroup

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

Example 7 with InternalRibbonGroup

use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.

the class RibbonTemplates method createFormSaveAndCancelActionsTemplate.

private InternalRibbonGroup createFormSaveAndCancelActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
    InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(ACTIONS, role);
    ribbonGroup.addItem(createFormSaveAction(viewDefinition));
    ribbonGroup.addItem(createFormSaveAndBackAction(viewDefinition));
    ribbonGroup.addItem(createFormCancelAction(viewDefinition));
    return ribbonGroup;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 8 with InternalRibbonGroup

use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.

the class RibbonTemplates method createGridActivateAndDeactivateActionsTemplate.

private InternalRibbonGroup createGridActivateAndDeactivateActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
    InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(STATES, role);
    ribbonGroup.addItem(createGridActivateAction(viewDefinition));
    ribbonGroup.addItem(createGridDeactivateAction(viewDefinition));
    return ribbonGroup;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 9 with InternalRibbonGroup

use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.

the class RibbonTemplates method createGridGenericExportActionsTemplate.

private InternalRibbonGroup createGridGenericExportActionsTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
    InternalRibbonGroup ribbonGroup = new RibbonGroupImpl(GENERIC_EXPORT, role);
    ribbonGroup.addItem(createGridExportCsvAction(viewDefinition));
    ribbonGroup.addItem(createGridExportPdfAction(viewDefinition));
    return ribbonGroup;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

Example 10 with InternalRibbonGroup

use of com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup in project qcadoo by qcadoo.

the class TemplateRibbonGroup method getRibbonGroup.

public InternalRibbonGroup getRibbonGroup(final RibbonTemplateParameters parameters, final ViewDefinition viewDefinition) {
    if (!PluginUtils.isEnabled(pluginIdentifier)) {
        return null;
    }
    List<InternalRibbonActionItem> itemsToApply = getFilteredList(parameters);
    if (itemsToApply.isEmpty()) {
        return null;
    }
    if (!checkCondition(condition, viewDefinition)) {
        return null;
    }
    InternalRibbonGroup group = new RibbonGroupImpl(name);
    for (InternalRibbonActionItem item : itemsToApply) {
        InternalRibbonActionItem itemCopy = item.getCopy();
        translateRibbonAction(itemCopy, viewDefinition);
        group.addItem(itemCopy);
    }
    return group;
}
Also used : RibbonGroupImpl(com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem) InternalRibbonGroup(com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)

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