use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class SitesConfigurationController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
if ("up".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveUp(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
} else if ("down".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveDown(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
}
}
} else if (source instanceof SingleSelection) {
if (source.getName().startsWith("site.security.") && source.getUserObject() instanceof SiteDefRow) {
SiteDefRow row = (SiteDefRow) source.getUserObject();
String selectCallbackId = row.getSecurityCallbackEl().getSelectedKey();
boolean needAlt = (securityCallbacks.containsKey(selectCallbackId) && securityCallbacks.get(selectCallbackId) instanceof SiteViewSecurityCallback);
if (row.getAlternativeControllerEl().isVisible() != needAlt) {
row.getAlternativeControllerEl().setVisible(needAlt);
tableEl.reset();
}
}
doSaveSettings();
} else if (source instanceof MultipleSelectionElement || source instanceof SingleSelection) {
doSaveSettings();
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class CopyEventToCalendarController method formOK.
@Override
protected void formOK(UserRequest ureq) {
for (MultipleSelectionElement copyEl : copyEls) {
if (copyEl.isEnabled() && copyEl.isAtLeastSelected(1)) {
KalendarRenderWrapper calendarWrapper = (KalendarRenderWrapper) copyEl.getUserObject();
Kalendar cal = calendarWrapper.getKalendar();
KalendarEvent clonedKalendarEvent = (KalendarEvent) XStreamHelper.xstreamClone(kalendarEvent);
if (clonedKalendarEvent.getKalendarEventLinks().size() > 0) {
clonedKalendarEvent.setKalendarEventLinks(new ArrayList<KalendarEventLink>());
}
calendarManager.addEventTo(cal, clonedKalendarEvent);
}
}
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project OpenOLAT by OpenOLAT.
the class CopyEventToCalendarController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("cal.copy.title");
copyEls = new ArrayList<>(calendars.size());
for (KalendarRenderWrapper calendarWrapper : calendars) {
String calId = calendarWrapper.getKalendar().getCalendarID();
String value = calendarWrapper.getDisplayName();
MultipleSelectionElement copyEl = uifactory.addCheckboxesHorizontal("cal_" + calId, null, formLayout, copy, new String[] { value });
copyEl.setUserObject(calendarWrapper);
if (calendarWrapper.getKalendar().getCalendarID().equals(kalendarEvent.getCalendar().getCalendarID())) {
// this is the calendar, the event comes from
copyEl.select(copy[0], true);
copyEl.setEnabled(false);
} else {
copyEl.setEnabled(calendarWrapper.getAccess() == KalendarRenderWrapper.ACCESS_READ_WRITE);
}
}
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class LicenseAdminConfigController method createActivationCheckBoxes.
private List<MultipleSelectionElement> createActivationCheckBoxes(LicenseType licenseType, List<LicenseHandler> handlers) {
List<MultipleSelectionElement> formItems = new ArrayList<>();
for (LicenseHandler handler : handlers) {
boolean handlerEnabled = licenseModule.isEnabled(handler);
if (handlerEnabled) {
String toggleName = "toggle-" + licenseType.getKey() + handler.getType();
MultipleSelectionElement toggle = uifactory.addCheckboxesHorizontal(toggleName, null, flc, keys, values);
toggle.setUserObject(new HandlerLicenseType(licenseType, handler));
toggle.addActionListener(FormEvent.ONCHANGE);
toggle.setAjaxOnly(true);
toggle.select(keys[0], licenseService.isActive(handler, licenseType));
formItems.add(toggle);
}
}
return formItems;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class CheckListAssessmentController method doDisableEditingMode.
private void doDisableEditingMode() {
table.setEditMode(false);
List<CheckListAssessmentRow> rows = model.getBackedUpRows();
for (CheckListAssessmentRow row : rows) {
MultipleSelectionElement[] checkedEls = row.getCheckedEl();
if (checkedEls != null) {
for (MultipleSelectionElement checkEl : checkedEls) {
flc.remove(checkEl);
}
}
row.setCheckedEl(null);
}
}
Aggregations