use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class GlossaryTermAndSynonymController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof FormLink) {
// a delete link has been pressed, remove textElement and synonym
FormLink delButton = (FormLink) source;
String synonymToDelete = (String) delButton.getUserObject();
glossItemSynonyms.remove(synonymToDelete);
createOrUpdateSynonymLayout(this.flc, glossItemSynonyms);
}
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink 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.FormLink in project OpenOLAT by OpenOLAT.
the class ExtendedFilterController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source instanceof FormLink) {
FormLink link = (FormLink) source;
Object uobject = link.getUserObject();
if (uobject instanceof FlexiTableFilter) {
FlexiTableFilter filter = (FlexiTableFilter) uobject;
filter.setSelected(!filter.isSelected());
}
}
fireEvent(ureq, Event.DONE_EVENT);
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class ExtendedFilterController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
int count = 0;
List<ExtendedFilter> filterNames = new ArrayList<>(filters.size());
for (FlexiTableFilter filter : filters) {
String name = "f-" + (++count);
FormLink filterLink = uifactory.addFormLink(name, formLayout, Link.LINK | Link.NONTRANSLATED);
filterLink.setI18nKey(filter.getLabel());
filterLink.setIconLeftCSS(filter.getIconLeftCSS());
filterLink.setUserObject(filter);
filterNames.add(new ExtendedFilter(filter, name));
}
if (formLayout instanceof FormLayoutContainer) {
((FormLayoutContainer) formLayout).contextPut("filters", filterNames);
}
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class SendDocumentsByEMailController method addIdentity.
private void addIdentity(Identity identity) {
FormLink rmLink = uifactory.addFormLink("rm-" + CodeHelper.getForeverUniqueID(), " ", null, userListBox, Link.NONTRANSLATED + Link.LINK);
IdentityWrapper wrapper = new IdentityWrapper(identity, rmLink);
rmLink.setIconLeftCSS("o_icon o_icon_remove");
rmLink.setUserObject(wrapper);
toValues.add(wrapper);
userListBox.setDirty(true);
}
Aggregations