use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (enabledEl == source) {
doEnableHandlers();
} else if (addLicenseTypeButton == source) {
doAddLicenseType(ureq);
} else if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
LicenseTypeRow licenseTypeRow = dataModel.getObject(se.getIndex());
if (CMD_UP.equals(cmd)) {
doUp(se.getIndex());
} else if (CMD_DOWN.equals(cmd)) {
doDown(se.getIndex());
} else if (CMD_TRANSLATE.equals(cmd)) {
doOpenTranslator(ureq, licenseTypeRow.getLicenseType());
} else if (CMD_EDIT.equals(cmd)) {
doEditLicenseType(ureq, licenseTypeRow.getLicenseType());
}
}
} else if (source instanceof MultipleSelectionElement) {
MultipleSelectionElement multipleSelectionElement = (MultipleSelectionElement) source;
doActivateLicenseType(multipleSelectionElement);
} else if (source instanceof SingleSelection) {
SingleSelection singleSelection = (SingleSelection) source;
String name = singleSelection.getName();
if (name.startsWith(DEFAULT_LICENSE_TYPE_PREFIX)) {
doSetDefaultLicenceType(source, singleSelection);
} else if (name.startsWith(LICENSOR_CREATOR_TYPE_PREFIX)) {
doSetLicensorCreator(source, singleSelection);
}
} else if (source instanceof FormLink) {
Object userObject = source.getUserObject();
if (userObject instanceof LicenseHandler) {
LicenseHandler handler = (LicenseHandler) userObject;
doEditLicensorConstant(ureq, handler);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class FormUIFactory method addCheckboxesVertical.
/**
* Create a multiple selection element with check-boxes that is rendered in vertical columns
* @param name
* @param i18nLabel
* @param formLayout
* @param keys
* @param values
* @param cssClasses
* @param columns
* @return
*/
public MultipleSelectionElement addCheckboxesVertical(String name, String i18nLabel, FormItemContainer formLayout, String[] keys, String[] values, String[] cssClasses, String[] iconLeftCSS, int columns) {
MultipleSelectionElement mse = new MultipleSelectionElementImpl(name, Layout.vertical, columns);
mse.setKeysAndValues(keys, values, cssClasses, iconLeftCSS);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class FormUIFactory method addCheckboxesDropdown.
public MultipleSelectionElement addCheckboxesDropdown(String name, String i18nLabel, FormItemContainer formLayout, String[] keys, String[] values, String[] cssClasses, String[] iconLeftCSS) {
MultipleSelectionElement mse = new MultipleSelectionElementImpl(name, Layout.dropdown);
mse.setKeysAndValues(keys, values, cssClasses, iconLeftCSS);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class MultiSelectionTriggerdDependencyRule method doesTrigger.
/**
* @see org.olat.core.gui.components.form.flexible.rules.FormItemDependencyRuleImpl#doesTrigger()
*/
@Override
protected boolean doesTrigger() {
MultipleSelectionElement mse = (MultipleSelectionElement) triggerElement;
Collection<String> selectedKeys = mse.getSelectedKeys();
boolean retval = false;
if (triggerVal == null) {
// meaning no selection in a multi selection element
retval = selectedKeys.isEmpty();
} else {
// check that value is in selection
retval = selectedKeys.contains(triggerVal);
}
return retval;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class CoreFunctionsController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// server informations
FormLayoutContainer serverCont = FormLayoutContainer.createDefaultFormLayout("functions", getTranslator());
formLayout.add(serverCont);
formLayout.add("functions", serverCont);
MultipleSelectionElement clusterEl = uifactory.addCheckboxesHorizontal("webdav", "core.webdav", serverCont, new String[] { "xx" }, new String[] { "" });
clusterEl.setEnabled(false);
clusterEl.select("xx", CoreSpringFactory.getImpl(WebDAVModule.class).isEnabled());
MultipleSelectionElement jsMathEl = uifactory.addCheckboxesHorizontal("jsmath", "core.jsMath", serverCont, new String[] { "xx" }, new String[] { "" });
jsMathEl.setEnabled(false);
jsMathEl.select("xx", Boolean.TRUE);
MultipleSelectionElement restEl = uifactory.addCheckboxesHorizontal("restapi", "core.restapi", serverCont, new String[] { "xx" }, new String[] { "" });
restEl.setEnabled(false);
RestModule restModule = CoreSpringFactory.getImpl(RestModule.class);
restEl.select("xx", restModule.isEnabled());
}
Aggregations