Search in sources :

Example 16 with FormItemContainer

use of org.olat.core.gui.components.form.flexible.FormItemContainer in project openolat by klemens.

the class TranslationToolStartCrumbController method initSearchItemsElements.

private void initSearchItemsElements(FormUIFactory formFactory, FormItemContainer formLayout, String[] bundlesKeys, String[] bundlesValues) {
    FormItemContainer searchLayoutContainer = FormLayoutContainer.createDefaultFormLayout("searchLayoutContainer", getTranslator());
    formLayout.add(searchLayoutContainer);
    // Add search input field
    searchInput = formFactory.addTextElement("searchInput", "start.search.input", 100, "", searchLayoutContainer);
    // Add search selecton for searching in keys or values
    String[] searchKeyValueKeys = new String[] { KEYS_KEY, KEYS_VALUE };
    String[] searchKeyValueValues = new String[] { translate("generic.key"), translate("generic.value") };
    searchKeyValueSelection = formFactory.addRadiosHorizontal("searchKeyValueSelection", "start.search.in", searchLayoutContainer, searchKeyValueKeys, searchKeyValueValues);
    searchKeyValueSelection.select(KEYS_VALUE, true);
    // Add search selecton for reference or target search
    String[] searchReferenceTargetKeys = new String[] { KEYS_REFERENCE, KEYS_TARGET };
    String[] searchReferenceTargetValues;
    if (customizingMode) {
        searchReferenceTargetValues = new String[] { translate("generic.customize.lang.reference"), translate("generic.customize.lang.target") };
    } else {
        searchReferenceTargetValues = new String[] { translate("generic.lang.reference"), translate("generic.lang.target") };
    }
    searchReferenceTargetSelection = formFactory.addRadiosHorizontal("searchReferenceTargetSelection", "start.search.in", searchLayoutContainer, searchReferenceTargetKeys, searchReferenceTargetValues);
    searchReferenceTargetSelection.select(KEYS_TARGET, true);
    // Add search bundles selector : reuse keys from above
    searchBundlesSelection = formFactory.addDropdownSingleselect("searchBundlesSelection", searchLayoutContainer, bundlesKeys, bundlesValues, null);
    searchBundlesSelection.setLabel("generic.limit.bundles", null);
    searchBundlesSelection.addActionListener(FormEvent.ONCHANGE);
    searchBundlesSelection.select(ALL_BUNDLES_IDENTIFYER, true);
    // Add search bundles children switch
    searchBundlesIncludeBundlesChildrenSwitch = formFactory.addCheckboxesHorizontal("searchBundlesIncludeBundlesChildrenSwitch", "generic.limit.bundles.includeChildren", searchLayoutContainer, new String[] { KEYS_ENABLED }, new String[] { KEYS_EMPTY });
    searchBundlesIncludeBundlesChildrenSwitch.select(KEYS_ENABLED, true);
    searchBundlesIncludeBundlesChildrenSwitch.addActionListener(FormEvent.ONCLICK);
    searchBundlesIncludeBundlesChildrenSwitch.setEnabled(false);
    // Add priority sort switch
    searchBundlesPrioritySortSwitch = formFactory.addCheckboxesHorizontal("searchBundlesPrioritySortSwitch", "generic.sort.by.priority", searchLayoutContainer, new String[] { KEYS_ENABLED }, new String[] { KEYS_EMPTY });
    searchBundlesPrioritySortSwitch.select(KEYS_ENABLED, true);
    searchBundlesPrioritySortSwitch.addActionListener(FormEvent.ONCLICK);
    formLayout.add(searchBundlesPrioritySortSwitch);
    // Add button to trigger search
    FormItemContainer searchButtonLayoutContainer = FormLayoutContainer.createButtonLayout("searchButtonLayoutContainer", getTranslator());
    searchLayoutContainer.add(searchButtonLayoutContainer);
    searchListButton = uifactory.addFormLink("searchListButton", "generic.listButton", null, searchButtonLayoutContainer, Link.BUTTON);
    searchTranslateButton = uifactory.addFormLink("searchTranslateButton", "generic.translateButton", null, searchButtonLayoutContainer, Link.BUTTON);
}
Also used : FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer)

Example 17 with FormItemContainer

use of org.olat.core.gui.components.form.flexible.FormItemContainer in project openolat by klemens.

the class CPMetadataEditController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    formLayout.setElementCssClass("o_sel_cp_metadata");
    // title-field
    String titleString = page.getTitle();
    title = uifactory.addTextElement("title", "cpmd.flexi.title", 256, titleString, formLayout);
    title.setElementCssClass("o_sel_cp_title");
    title.setDisplaySize(32);
    title.setMandatory(true);
    title.setNotEmptyCheck("cpmd.flexi.mustbefilled");
    FormItemContainer buttonContainer = FormLayoutContainer.createButtonLayout("buttonContainer", getTranslator());
    formLayout.add(buttonContainer);
    uifactory.addFormSubmitButton("save", buttonContainer);
    uifactory.addFormCancelButton("cancel", buttonContainer, ureq, getWindowControl());
}
Also used : FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer)

Example 18 with FormItemContainer

use of org.olat.core.gui.components.form.flexible.FormItemContainer in project openolat by klemens.

the class OAuthAdminController method initCustomProviders.

private void initCustomProviders() {
    // remove old ones
    for (ConfigurableProviderWrapper providerWrapper : providerWrappers) {
        FormItemContainer layoutCont = providerWrapper.getLayoutCont();
        customProvidersCont.remove(layoutCont);
    }
    providerWrappers.clear();
    List<OAuthSPI> configurableSpies = oauthModule.getAllConfigurableSPIs();
    for (OAuthSPI configurableSpi : configurableSpies) {
        if (configurableSpi instanceof OpenIdConnectFullConfigurableProvider) {
            ConfigurableProviderWrapper wrapper = initOpenIDConnectIFFullConfigurableProviders(customProvidersCont, (OpenIdConnectFullConfigurableProvider) configurableSpi);
            if (wrapper != null) {
                providerWrappers.add(wrapper);
            }
        }
    }
}
Also used : OpenIdConnectFullConfigurableProvider(org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider) OAuthSPI(org.olat.login.oauth.OAuthSPI) FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer)

Aggregations

FormItemContainer (org.olat.core.gui.components.form.flexible.FormItemContainer)18 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Map (java.util.Map)6 Collectors (java.util.stream.Collectors)6 UserRequest (org.olat.core.gui.UserRequest)6 FormItem (org.olat.core.gui.components.form.flexible.FormItem)6 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)6 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)6 FormEvent (org.olat.core.gui.components.form.flexible.impl.FormEvent)6 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)6 Link (org.olat.core.gui.components.link.Link)6 Controller (org.olat.core.gui.control.Controller)6 WindowControl (org.olat.core.gui.control.WindowControl)6 HashSet (java.util.HashSet)4 Set (java.util.Set)4 Component (org.olat.core.gui.components.Component)4 LinkFactory (org.olat.core.gui.components.link.LinkFactory)4 TooledController (org.olat.core.gui.components.stack.TooledController)4 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)4