Search in sources :

Example 11 with RibbonActionItemImpl

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

the class RibbonTemplates method createGridDeactivateAction.

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

Example 12 with RibbonActionItemImpl

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

the class RibbonTemplates method createGridNewAction.

private InternalRibbonActionItem createGridNewAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonNewAction = new RibbonActionItemImpl();
    ribbonNewAction.setAction(RibbonUtils.translateRibbonAction("#{grid}.performNew;", viewDefinition));
    ribbonNewAction.setIcon("newIcon24.png");
    ribbonNewAction.setName("new");
    ribbonNewAction.setEnabled(true);
    ribbonNewAction.setType(RibbonActionItem.Type.BIG_BUTTON);
    return ribbonNewAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 13 with RibbonActionItemImpl

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

the class RibbonTemplates method createNavigationTemplate.

private InternalRibbonGroup createNavigationTemplate(final ViewDefinition viewDefinition, final SecurityRole role) {
    InternalRibbonActionItem ribbonBackAction = new RibbonActionItemImpl();
    ribbonBackAction.setAction(RibbonUtils.translateRibbonAction("#{window}.performBack", viewDefinition));
    ribbonBackAction.setIcon("backIcon24.png");
    ribbonBackAction.setName("back");
    ribbonBackAction.setEnabled(true);
    ribbonBackAction.setType(RibbonActionItem.Type.BIG_BUTTON);
    InternalRibbonGroup ribbonGroup = new RibbonGroupImpl("navigation", role);
    ribbonGroup.addItem(ribbonBackAction);
    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 14 with RibbonActionItemImpl

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

the class RibbonTemplates method createGridDeleteAction.

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

Example 15 with RibbonActionItemImpl

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

the class RibbonTemplates method createFormCopyAction.

private InternalRibbonActionItem createFormCopyAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonCopyAction = new RibbonActionItemImpl();
    ribbonCopyAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performCopy;", viewDefinition));
    ribbonCopyAction.setIcon("copyIcon16.png");
    ribbonCopyAction.setName("copy");
    ribbonCopyAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    ribbonCopyAction.setEnabled(false);
    ribbonCopyAction.setDefaultEnabled(false);
    ribbonCopyAction.setScript("var listener = {onSetValue: function(value) {if (!value || !value.content) return; if (value.content.entityId) {" + "this.enable();} else {this.disable();}}}; #{form}.addOnChangeListener(listener);");
    return ribbonCopyAction;
}
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)18 RibbonActionItemImpl (com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl)18 InternalRibbonGroup (com.qcadoo.view.internal.ribbon.model.InternalRibbonGroup)2 RibbonGroupImpl (com.qcadoo.view.internal.ribbon.model.RibbonGroupImpl)2 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)1 RibbonComboBox (com.qcadoo.view.api.ribbon.RibbonComboBox)1 RibbonComboItem (com.qcadoo.view.api.ribbon.RibbonComboItem)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