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);
}
}
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);
}
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);
}
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);
}
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();
}
Aggregations