use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class EditMembershipController method createSelection.
private MultipleSelectionElement createSelection(boolean selected, boolean enabled, String role) {
String name = "cb" + UUID.randomUUID().toString().replace("-", "");
MultipleSelectionElement selection = new MultipleSelectionElementImpl(name, Layout.horizontal);
selection.setElementCssClass("o_sel_role");
selection.addActionListener(FormEvent.ONCHANGE);
selection.setKeysAndValues(keys, values, new String[] { "o_sel_role_".concat(role) }, null);
flc.add(name, selection);
selection.select(keys[0], selected);
selection.setEnabled(enabled);
return selection;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class GroupsAndRightsController method createSelection.
private MultipleSelectionElement createSelection(boolean selected) {
String name = "cb_" + (++counter);
MultipleSelectionElement selection = uifactory.addCheckboxesHorizontal(name, null, flc, keys, values);
selection.setEnabled(!readOnly);
flc.add(name, selection);
if (selected) {
selection.select(keys[0], true);
}
return selection;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class MultiSPController method create.
private void create(MultipleSelectionElement selection, ICourse course, CourseNode parentNode) {
SelectNodeObject node = (SelectNodeObject) selection.getUserObject();
if (selection.isMultiselect() && selection.isSelected(0)) {
VFSItem item = node.getItem();
CourseNode newNode = null;
if (item instanceof VFSLeaf) {
// create node
newNode = createCourseNode(item, "sp");
ModuleConfiguration moduleConfig = newNode.getModuleConfiguration();
String path = getRelativePath(item);
moduleConfig.set(SPEditController.CONFIG_KEY_FILE, path);
moduleConfig.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, true);
} else if (item instanceof VFSContainer) {
// add structure
newNode = createCourseNode(item, "st");
}
int pos = -1;
if (position >= 0 && selectedNode.getCourseNode().getIdent().equals(parentNode.getIdent())) {
pos = position++;
}
if (pos < 0 || pos >= parentNode.getChildCount()) {
course.getEditorTreeModel().addCourseNode(newNode, parentNode);
} else {
course.getEditorTreeModel().insertCourseNodeAt(newNode, parentNode, pos);
}
if (item instanceof VFSContainer) {
parentNode = newNode;
}
}
// recurse
for (MultipleSelectionElement childElement : node.getChildren()) {
create(childElement, course, parentNode);
}
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class VideoAdminSetController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == deactivationHintController) {
if (event == Event.CANCELLED_EVENT) {
} else {
if (DialogBoxUIFactory.isYesEvent(event)) {
videoModule.setTranscodingEnabled(false);
enableTranscodingEl.select("on", false);
updateResolutionOptions();
} else {
MultipleSelectionElement el = (MultipleSelectionElement) deactivationHintController.getUserObject();
el.select("on", true);
}
}
}
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class EPArtefactAttributeSettingController method formInnerEvent.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formInnerEvent(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.form.flexible.FormItem,
* org.olat.core.gui.components.form.flexible.impl.FormEvent)
*/
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof MultipleSelectionElement) {
MultipleSelectionElement chkBox = (MultipleSelectionElement) source;
artAttribConfig.put(chkBox.getName(), chkBox.isSelected(0));
}
}
Aggregations