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;
}
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;
}
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;
}
Aggregations