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