Search in sources :

Example 36 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.

the class FlexiTableElementImpl method setExtendedSearch.

@Override
public void setExtendedSearch(ExtendedFlexiTableSearchController controller) {
    extendedSearchCtrl = controller;
    if (extendedSearchCtrl != null) {
        extendedSearchCtrl.addControllerListener(this);
        String dispatchId = component.getDispatchID();
        extendedSearchButton = new FormLinkImpl(dispatchId + "_extSearchButton", "rExtSearchButton", "extsearch", Link.BUTTON);
        extendedSearchButton.setTranslator(translator);
        extendedSearchButton.setIconLeftCSS("o_icon o_icon_search");
        components.put("rExtSearchB", extendedSearchButton);
        rootFormAvailable(extendedSearchButton);
        extendedSearchButton.setElementCssClass("o_sel_flexi_extendedsearch");
        components.put("rExtSearchCmp", controller.getInitialFormItem());
    }
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 37 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.

the class FlexiTableElementImpl method setExtendedFilterButton.

@Override
public void setExtendedFilterButton(String label, List<FlexiTableFilter> extendedFilters) {
    if (StringHelper.containsNonWhitespace(label) && extendedFilters != null && extendedFilters.size() > 0) {
        this.extendedFilters = extendedFilters;
        String dispatchId = component.getDispatchID();
        extendedFilterButton = new FormLinkImpl(dispatchId + "_extFilterButton", "rExtFilterButton", "extfilter", Link.BUTTON | Link.NONTRANSLATED);
        extendedFilterButton.setI18nKey(label);
        extendedFilterButton.setTranslator(translator);
        extendedFilterButton.setIconLeftCSS("o_icon o_icon_filter");
        components.put("rExtFilterB", extendedFilterButton);
        rootFormAvailable(extendedFilterButton);
        extendedFilterButton.setElementCssClass("o_sel_flexi_extendedsearch");
    } else {
        extendedFilterButton = null;
        extendedFilters = null;
    }
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 38 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.

the class FlexiTableElementImpl method setAvailableRendererTypes.

@Override
public void setAvailableRendererTypes(FlexiTableRendererType... rendererTypes) {
    this.availableRendererType = rendererTypes;
    if (rendererTypes != null && rendererTypes.length > 1) {
        String dispatchId = component.getDispatchID();
        // custom
        customTypeButton = new FormLinkImpl(dispatchId + "_customRTypeButton", "rCustomRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
        customTypeButton.setTranslator(translator);
        customTypeButton.setIconLeftCSS("o_icon o_icon_table_custom o_icon-lg");
        customTypeButton.setActive(FlexiTableRendererType.custom == rendererType);
        components.put("rTypeCustom", customTypeButton);
        // classic tables
        classicTypeButton = new FormLinkImpl(dispatchId + "_classicRTypeButton", "rClassicRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
        classicTypeButton.setTranslator(translator);
        classicTypeButton.setIconLeftCSS("o_icon o_icon_table o_icon-lg");
        classicTypeButton.setActive(FlexiTableRendererType.classic == rendererType);
        components.put("rTypeClassic", classicTypeButton);
        if (getRootForm() != null) {
            rootFormAvailable(customTypeButton);
            rootFormAvailable(classicTypeButton);
        }
    }
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 39 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.

the class BasicStep method getStepTitle.

/**
 * generates FormLink with defined i18nKey, otherwise override and provide
 * your own FormItem here.
 * @see org.olat.core.gui.control.generic.wizard.Step#getStepTitle()
 */
public FormItem getStepTitle() {
    if (i18nStepTitle == null) {
        throw new AssertException("no i18n key set for step title, or getStepTitle() not overridden.");
    }
    FormLink fl;
    if (i18nArguments != null && i18nArguments.length > 0) {
        String title = this.getTranslator().translate(i18nStepTitle, i18nArguments);
        fl = new FormLinkImpl(i18nStepTitle, null, title, Link.FLEXIBLEFORMLNK + Link.NONTRANSLATED);
    } else {
        fl = new FormLinkImpl(i18nStepTitle, i18nStepTitle);
    }
    fl.setTranslator(getTranslator());
    return fl;
}
Also used : AssertException(org.olat.core.logging.AssertException) FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 40 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.

the class TranslationToolStartCrumbController method initExistingItemsElements.

private void initExistingItemsElements(FormUIFactory formFactory, FormItemContainer formLayout, String[] bundlesKeys, String[] bundlesValues) {
    // Add existing bundles selector
    existingBundlesSelection = formFactory.addDropdownSingleselect("existingBundlesSelection", this.flc, bundlesKeys, bundlesValues, null);
    existingBundlesSelection.addActionListener(FormEvent.ONCHANGE);
    existingBundlesSelection.select(ALL_BUNDLES_IDENTIFYER, true);
    // Add existing bundles children switch
    String[] existingBundlesInclude = new String[] { translate("generic.limit.bundles.includeChildren") };
    existingBundlesIncludeBundlesChildrenSwitch = formFactory.addCheckboxesHorizontal("existingBundlesIncludeBundlesChildrenSwitch", null, flc, new String[] { KEYS_ENABLED }, // disabled label by setting i18nLabel to null
    existingBundlesInclude);
    existingBundlesIncludeBundlesChildrenSwitch.select(KEYS_ENABLED, true);
    existingBundlesIncludeBundlesChildrenSwitch.addActionListener(FormEvent.ONCLICK);
    formLayout.add(existingBundlesIncludeBundlesChildrenSwitch);
    existingBundlesIncludeBundlesChildrenSwitch.setEnabled(false);
    // Add priority sort switch
    String[] existingBundlespPrio = new String[] { translate("generic.sort.by.priority") };
    existingBundlesPrioritySortSwitch = formFactory.addCheckboxesHorizontal("existingBundlesPrioritySortSwitch", null, flc, new String[] { KEYS_ENABLED }, // disabled label by setting i18nLabel to null
    existingBundlespPrio);
    existingBundlesPrioritySortSwitch.select(KEYS_ENABLED, true);
    existingBundlesPrioritySortSwitch.addActionListener(FormEvent.ONCLICK);
    formLayout.add(existingBundlesPrioritySortSwitch);
    // Add button to trigger existing keys search
    existingListButton = new FormLinkImpl("existingListButton", "existingListButton", "generic.listButton", Link.BUTTON);
    formLayout.add(existingListButton);
    existingTranslateButton = new FormLinkImpl("existingTranslateButton", "existingTranslateButton", "generic.translateButton", Link.BUTTON);
    formLayout.add(existingTranslateButton);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Aggregations

FormLinkImpl (org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)52 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)12 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)8 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)6 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 FormItem (org.olat.core.gui.components.form.flexible.FormItem)4 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)4 BusinessGroupShort (org.olat.group.BusinessGroupShort)4 BGArea (org.olat.group.area.BGArea)4 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Locale (java.util.Locale)2 TimeZone (java.util.TimeZone)2 ValidationError (org.olat.core.gui.components.form.ValidationError)2 DateChooser (org.olat.core.gui.components.form.flexible.elements.DateChooser)2 AutoCompleterImpl (org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)2 ItemValidatorProvider (org.olat.core.gui.components.form.flexible.impl.elements.ItemValidatorProvider)2