Search in sources :

Example 1 with TemplateRibbonGroupsPack

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

the class TemplateRibbonGroupsPackTest method init.

@Before
public final void init() {
    MockitoAnnotations.initMocks(this);
    templateRibbonGroupsPack = new TemplateRibbonGroupsPack(template, null, viewDefinition);
}
Also used : TemplateRibbonGroupsPack(com.qcadoo.view.internal.ribbon.templates.model.TemplateRibbonGroupsPack) Before(org.junit.Before)

Example 2 with TemplateRibbonGroupsPack

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

the class RibbonTemplatesServiceImpl method applyTemplate.

@Override
public void applyTemplate(final InternalRibbon ribbon, final RibbonTemplateParameters parameters, final ViewDefinition viewDefinition) {
    RibbonTemplate template = templates.get(getTemplateFullName(parameters.getTemplatePlugin(), parameters.getTemplateName()));
    if (template == null) {
        throw new IllegalStateException("ribbon template '" + parameters.getTemplatePlugin() + "." + parameters.getTemplateName() + "' not found");
    }
    template.parseParameters(parameters);
    ribbon.addGroupsPack(new TemplateRibbonGroupsPack(template, parameters, viewDefinition));
}
Also used : TemplateRibbonGroupsPack(com.qcadoo.view.internal.ribbon.templates.model.TemplateRibbonGroupsPack) RibbonTemplate(com.qcadoo.view.internal.ribbon.templates.model.RibbonTemplate)

Aggregations

TemplateRibbonGroupsPack (com.qcadoo.view.internal.ribbon.templates.model.TemplateRibbonGroupsPack)2 RibbonTemplate (com.qcadoo.view.internal.ribbon.templates.model.RibbonTemplate)1 Before (org.junit.Before)1