Search in sources :

Example 1 with InternalRibbonActionItem

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

the class RibbonTemplates method createFormSaveAction.

private InternalRibbonActionItem createFormSaveAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonSaveAction = new RibbonActionItemImpl();
    ribbonSaveAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performSave;", viewDefinition));
    ribbonSaveAction.setIcon("saveIcon24.png");
    ribbonSaveAction.setName("save");
    ribbonSaveAction.setEnabled(true);
    ribbonSaveAction.setType(RibbonActionItem.Type.BIG_BUTTON);
    return ribbonSaveAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 2 with InternalRibbonActionItem

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

the class RibbonTemplates method createFormSaveAndBackAction.

private InternalRibbonActionItem createFormSaveAndBackAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonSaveBackAction = new RibbonActionItemImpl();
    ribbonSaveBackAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performSave; #{window}.performBack;", viewDefinition));
    ribbonSaveBackAction.setIcon("saveBackIcon24.png");
    ribbonSaveBackAction.setName("saveBack");
    ribbonSaveBackAction.setEnabled(true);
    ribbonSaveBackAction.setType(RibbonActionItem.Type.BIG_BUTTON);
    return ribbonSaveBackAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 3 with InternalRibbonActionItem

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

the class RibbonTemplates method createGridCopyAction.

private InternalRibbonActionItem createGridCopyAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonCopyAction = new RibbonActionItemImpl();
    ribbonCopyAction.setAction(RibbonUtils.translateRibbonAction("#{grid}.performCopy;", viewDefinition));
    ribbonCopyAction.setIcon("copyIcon16.png");
    ribbonCopyAction.setName("copy");
    ribbonCopyAction.setEnabled(false);
    ribbonCopyAction.setDefaultEnabled(false);
    ribbonCopyAction.setScript("var listener = {onChange: function(selectedArray) {if (selectedArray.length == 0) {" + "this.disable();} else {this.enable();}}}; #{grid}.addOnChangeListener(listener);");
    ribbonCopyAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    return ribbonCopyAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 4 with InternalRibbonActionItem

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

Example 5 with InternalRibbonActionItem

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

the class RibbonTemplates method createGridExportPdfAction.

private InternalRibbonActionItem createGridExportPdfAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonExportPdfAction = new RibbonActionItemImpl();
    ribbonExportPdfAction.setIcon("pdfIcon16.png");
    ribbonExportPdfAction.setName("pdf");
    ribbonExportPdfAction.setEnabled(true);
    ribbonExportPdfAction.setScript("var listener = {onClick: function() {#{grid}.performEvent('exportToPdf', [], 'exportToPdf');}};" + " this.addOnChangeListener(listener);");
    ribbonExportPdfAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    return ribbonExportPdfAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Aggregations

InternalRibbonActionItem (com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)21 RibbonActionItemImpl (com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl)18 InternalRibbonGroup (com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)4 RibbonGroupImpl (com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl)4 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)3 RibbonComboItem (com.qcadoo.view.api.ribbon.RibbonComboItem)2 RibbonComboBox (com.qcadoo.view.api.ribbon.RibbonComboBox)1 InternalRibbonComboItem (com.qcadoo.view.internal.ribbon.model.InternalRibbonComboItem)1 RibbonComboBoxImpl (com.qcadoo.view.internal.ribbon.model.RibbonComboBoxImpl)1 RibbonComboItemImpl (com.qcadoo.view.internal.ribbon.model.RibbonComboItemImpl)1 ViewDefinitionParserNodeException (com.qcadoo.view.internal.xml.ViewDefinitionParserNodeException)1 Node (org.w3c.dom.Node)1 NodeList (org.w3c.dom.NodeList)1