Search in sources :

Example 6 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer 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 7 with FormLayoutContainer

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

the class I18nConfigSubDeletePackageController method initForm.

/**
 * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
 */
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // A title, displayed in fieldset
    setFormTitle("configuration.management.package.delete.title");
    setFormDescription("configuration.management.package.delete.description");
    // Add cancel and submit in button group layout
    FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    formLayout.add(buttonGroupLayout);
    cancelButton = uifactory.addFormLink("cancel", buttonGroupLayout, Link.BUTTON);
    submitButton = uifactory.addFormSubmitButton("configuration.management.package.delete", buttonGroupLayout);
    // enable as soon as something is checked
    submitButton.setEnabled(false);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 8 with FormLayoutContainer

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

the class I18nConfigSubImportLangController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // A title, displayed in fieldset
    setFormTitle("configuration.management.package.import.title");
    if (i18nModule.isTransToolEnabled()) {
        setFormDescription("configuration.management.package.import.description.transserver");
    } else {
        setFormDescription("configuration.management.package.import.description");
    }
    // 
    // The import file upload
    importFile = uifactory.addFileElement(getWindowControl(), "configuration.management.package.import.file", formLayout);
    importFile.setLabel("configuration.management.package.import.file", null);
    importFile.setMandatory(true, "configuration.management.package.import.file.error.mandatory");
    // Limit to jar files and set upload limit to 50 MB
    importFile.setMaxUploadSizeKB(50000, "configuration.management.package.import.file.error.size", null);
    Set<String> mimeTypes = new HashSet<String>();
    mimeTypes.add("application/java-archive");
    mimeTypes.add("application/x-jar");
    mimeTypes.add("application/x-java-jar");
    importFile.limitToMimeType(mimeTypes, "configuration.management.package.import.file.error.type", null);
    // trigger auto-upload
    importFile.addActionListener(FormEvent.ONCHANGE);
    // 
    // Add checkboxes for the found languages - hide so far
    String[] langKeys = new String[] {};
    importKeys = uifactory.addCheckboxesVertical("configuration.management.package.import.select", flc, langKeys, langKeys, 1);
    importKeys.setVisible(false);
    // 
    // Add cancel and submit in button group layout
    FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    formLayout.add(buttonGroupLayout);
    cancelButton = uifactory.addFormLink("cancel", buttonGroupLayout, Link.BUTTON);
    uifactory.addFormSubmitButton("configuration.management.package.import", buttonGroupLayout);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) HashSet(java.util.HashSet)

Example 9 with FormLayoutContainer

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

the class I18nConfigSubExportLangController method initForm.

/**
 * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
 */
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // A title, displayed in fieldset
    setFormTitle("configuration.management.package.export.title");
    setFormDescription("configuration.management.package.export.description");
    // 
    // Add languages checkboxes
    Set<String> availableKeysUnsorted = i18nModule.getAvailableLanguageKeys();
    String[] availableKeys = ArrayHelper.toArray(availableKeysUnsorted);
    String[] availableValues = new String[availableKeys.length];
    for (int i = 0; i < availableKeys.length; i++) {
        String key = availableKeys[i];
        String explLang = i18nMgr.getLanguageInEnglish(key, false);
        String all = explLang;
        if (explLang != null && !explLang.equals(key))
            all += " (" + key + ")";
        availableValues[i] = all;
    }
    ArrayHelper.sort(availableKeys, availableValues, false, true, false);
    String[] availableLangCssClasses = i18nMgr.createLanguageFlagsCssClasses(availableKeys, "o_flag");
    exportLangSelection = uifactory.addCheckboxesVertical("configuration.exportLangSelection", null, formLayout, availableKeys, availableValues, availableLangCssClasses, null, 1);
    exportLangSelection.addActionListener(FormEvent.ONCLICK);
    // Add cancel and submit in button group layout
    FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    formLayout.add(buttonGroupLayout);
    cancelButton = uifactory.addFormLink("cancel", buttonGroupLayout, Link.BUTTON);
    submitButton = uifactory.addFormSubmitButton("configuration.management.package.export", buttonGroupLayout);
    // enable as soon as something is checked
    submitButton.setEnabled(false);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 10 with FormLayoutContainer

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

the class MailTemplateForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (!mandatoryEmail) {
        sendMail = uifactory.addCheckboxesVertical("sendmail", "", formLayout, new String[] { "xx" }, new String[] { translate("mailtemplateform.sendMailSwitchElem") }, 1);
        sendMail.addActionListener(FormEvent.ONCLICK);
    }
    subjectElem = uifactory.addTextElement("subjectElem", "mailtemplateform.subject", 128, template.getSubjectTemplate(), formLayout);
    subjectElem.setDisplaySize(60);
    subjectElem.setMandatory(true);
    bodyElem = uifactory.addTextAreaElement("bodyElem", "mailtemplateform.body", -1, 15, 60, true, template.getBodyTemplate(), formLayout);
    bodyElem.setMandatory(true);
    ccSender = uifactory.addCheckboxesVertical("tcpfrom", "", formLayout, new String[] { "xx" }, new String[] { translate(NLS_CONTACT_SEND_CP_FROM) }, 1);
    ccSender.setVisible(cc);
    FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
    formLayout.add(buttonGroupLayout);
    if (useSubmit) {
        uifactory.addFormSubmitButton("continue", "mailtemplateform.continue", buttonGroupLayout);
    }
    if (useCancel) {
        uifactory.addFormCancelButton("cancel", buttonGroupLayout, ureq, getWindowControl());
    }
    update();
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Aggregations

FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)844 ArrayList (java.util.ArrayList)96 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)76 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)76 Date (java.util.Date)56 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)56 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)42 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)40 FormItem (org.olat.core.gui.components.form.flexible.FormItem)38 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)32 Translator (org.olat.core.gui.translator.Translator)30 Identity (org.olat.core.id.Identity)30 VFSContainer (org.olat.core.util.vfs.VFSContainer)28 File (java.io.File)26 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)26 BusinessGroup (org.olat.group.BusinessGroup)26 HashMap (java.util.HashMap)22 HashSet (java.util.HashSet)22 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)22 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)20