Search in sources :

Example 66 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) MultipleSelectionElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)

Example 67 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)

Example 68 with MultipleSelectionElement

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);
    }
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) ModuleConfiguration(org.olat.modules.ModuleConfiguration) MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) CourseNode(org.olat.course.nodes.CourseNode)

Example 69 with MultipleSelectionElement

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);
            }
        }
    }
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)

Example 70 with MultipleSelectionElement

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));
    }
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)

Aggregations

MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)136 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)22 ArrayList (java.util.ArrayList)20 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)16 MultipleSelectionElementImpl (org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)16 HashMap (java.util.HashMap)12 HashSet (java.util.HashSet)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)12 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)10 FormItem (org.olat.core.gui.components.form.flexible.FormItem)8 Identity (org.olat.core.id.Identity)8 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)8 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)6 ICourse (org.olat.course.ICourse)6 Checkbox (org.olat.course.nodes.cl.model.Checkbox)6 VFSContainer (org.olat.core.util.vfs.VFSContainer)5 VFSItem (org.olat.core.util.vfs.VFSItem)5 Section (org.olat.modules.portfolio.Section)5 File (java.io.File)4 UserShortDescription (org.olat.admin.user.UserShortDescription)4