Search in sources :

Example 1 with FormLink

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

Example 2 with FormLink

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);
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) LicenseHandler(org.olat.core.commons.services.license.LicenseHandler) SingleSelection(org.olat.core.gui.components.form.flexible.elements.SingleSelection) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 3 with FormLink

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

Example 4 with FormLink

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);
    }
}
Also used : ArrayList(java.util.ArrayList) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 5 with FormLink

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

Aggregations

FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)376 ArrayList (java.util.ArrayList)108 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)64 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)40 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)36 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)34 List (java.util.List)30 FormItem (org.olat.core.gui.components.form.flexible.FormItem)28 HashMap (java.util.HashMap)26 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)24 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)22 Date (java.util.Date)18 Map (java.util.Map)18 Link (org.olat.core.gui.components.link.Link)18 Identity (org.olat.core.id.Identity)18 Component (org.olat.core.gui.components.Component)16 RichTextElement (org.olat.core.gui.components.form.flexible.elements.RichTextElement)16 FormEvent (org.olat.core.gui.components.form.flexible.impl.FormEvent)16 Controller (org.olat.core.gui.control.Controller)16 Event (org.olat.core.gui.control.Event)16