Search in sources :

Example 16 with RibbonActionItemImpl

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

the class RibbonTemplates method createFormActivateAction.

private InternalRibbonActionItem createFormActivateAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonActivateAction = new RibbonActionItemImpl();
    ribbonActivateAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performActivate;", viewDefinition));
    ribbonActivateAction.setIcon("unactiveVisibleIcon.png");
    ribbonActivateAction.setName("activate");
    ribbonActivateAction.setEnabled(false);
    ribbonActivateAction.setScript("var listener = {onSetValue: function(value) {if (!value || !value.content) return; if (value.content.entityId " + "&& !value.content.isActive) {this.enable();} else {this.disable();}}}; #{form}.addOnChangeListener(listener);");
    ribbonActivateAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    return ribbonActivateAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 17 with RibbonActionItemImpl

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

the class RibbonTemplates method createFormSaveAndNewAction.

private InternalRibbonActionItem createFormSaveAndNewAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonSaveNewAction = new RibbonActionItemImpl();
    ribbonSaveNewAction.setAction(RibbonUtils.translateRibbonAction("#{form}.performSaveAndClear;", viewDefinition));
    ribbonSaveNewAction.setIcon("saveNewIcon16.png");
    ribbonSaveNewAction.setName("saveNew");
    ribbonSaveNewAction.setEnabled(true);
    ribbonSaveNewAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    return ribbonSaveNewAction;
}
Also used : RibbonActionItemImpl(com.qcadoo.view.internal.ribbon.model.RibbonActionItemImpl) InternalRibbonActionItem(com.qcadoo.view.internal.ribbon.model.InternalRibbonActionItem)

Example 18 with RibbonActionItemImpl

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

the class RibbonTemplates method createGridActivateAction.

private InternalRibbonActionItem createGridActivateAction(final ViewDefinition viewDefinition) {
    InternalRibbonActionItem ribbonActivateAction = new RibbonActionItemImpl();
    ribbonActivateAction.setAction(RibbonUtils.translateRibbonAction("#{grid}.performActivate;", viewDefinition));
    ribbonActivateAction.setIcon("unactiveVisibleIcon.png");
    ribbonActivateAction.setName("activate");
    ribbonActivateAction.setEnabled(false);
    ribbonActivateAction.setScript("var listener = {onChange: function(selectedArray) {if (selectedArray.length == 0) {" + "this.disable();} else {this.enable();}}}; #{grid}.addOnChangeListener(listener);");
    ribbonActivateAction.setType(RibbonActionItem.Type.SMALL_BUTTON);
    return ribbonActivateAction;
}
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