use of org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit in project openolat by klemens.
the class WikiEditArticleForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
wikiContent = uifactory.addTextAreaElement("wikiContentElement", 20, 110, page.getContent(), formLayout);
wikiContent.setElementCssClass("o_sel_wiki_content");
wikiContent.setLabel(null, null);
// OO-31 prevent trimming, so first line can be with inset (wiki pre-formatted)
wikiContent.preventValueTrim(true);
wikiContent.setFocus(true);
updateComment = uifactory.addTextElement("wikiUpdateComment", null, 40, "", formLayout);
updateComment.setExampleKey("update.comment", null);
// Button layout
final FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
formLayout.add(buttonLayout);
FormSubmit submit = uifactory.addFormSubmitButton("save", buttonLayout);
submit.setElementCssClass("o_sel_wiki_save");
FormLink saveAndClose = uifactory.addFormLink("save.and.close", buttonLayout, Link.BUTTON);
saveAndClose.setElementCssClass("o_sel_wiki_save_and_close");
if (getIdentity().getKey().equals(Long.valueOf(page.getInitalAuthor())) || securityCallback.mayEditWikiMenu()) {
uifactory.addFormLink("delete.page", buttonLayout, Link.BUTTON);
}
uifactory.addFormLink("preview", buttonLayout, Link.BUTTON);
uifactory.addFormLink("media.upload", buttonLayout, Link.BUTTON);
uifactory.addFormLink("manage.media", buttonLayout, Link.BUTTON);
uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit in project openolat by klemens.
the class FileCreatorController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
setFormTitle("filecreator.text.newfile");
// Global target directory
String path = "/ " + baseContainer.getName();
VFSContainer container = baseContainer.getParentContainer();
while (container != null) {
path = "/ " + container.getName() + " " + path;
container = container.getParentContainer();
}
uifactory.addStaticTextElement("ul.target", path, formLayout);
// Sub path, can be modified
targetSubPath = uifactory.addInlineTextElement("ul.target.child", subfolderPath, formLayout, this);
targetSubPath.setLabel("ul.target.child", null);
// The file name of the new file
fileNameElement = FormUIFactory.getInstance().addTextElement("fileName", "filecreator.filename", 50, "", formLayout);
fileNameElement.setPlaceholderKey("filecreator.filename.placeholder", null);
fileNameElement.setMandatory(true);
// Add buttons
FormLayoutContainer buttons = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
formLayout.add(buttons);
Submit createFile = new FormSubmit("submit", "button.create");
buttons.add(createFile);
uifactory.addFormCancelButton("cancel", buttons, ureq, getWindowControl());
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit in project openolat by klemens.
the class DENDatesForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// determine if FormController is in CREATE_DATES_LAYOUT mode
boolean createsDateLayout = layout == CREATE_DATES_LAYOUT;
// create form elements
subjectTE = uifactory.addTextElement("subject", "config.dates.subject", 25, "", formLayout);
subjectTE.setDisplaySize(25);
setupTextElementDependingOn(createsDateLayout, subjectTE);
locationTE = uifactory.addTextElement("location", "config.dates.location", 25, "", formLayout);
locationTE.setDisplaySize(25);
setupTextElementDependingOn(createsDateLayout, locationTE);
commentTE = uifactory.addTextElement("comment", "config.dates.comment", 100, "", formLayout);
commentTE.setDisplaySize(25);
commentTE.setRegexMatchCheck("[^\"\\{\\}]*", "form.error.format");
commentTE.showError(false);
// Label of duration is depending on EDIT_SINGLE_DAE_LAYOUT
String durationTELabel = layout == EDIT_SINGLE_DATE_LAYOUT ? "config.dates.duration.single" : "config.dates.duration";
durationTE = uifactory.addTextElement("duration", durationTELabel, 5, "00:00", formLayout);
durationTE.setDisplaySize(5);
durationTE.setRegexMatchCheck("\\d{1,2}:\\d\\d", "form.error.format");
durationTE.setExampleKey("config.dates.duration.example", null);
durationTE.setNotEmptyCheck("form.error.notempty");
durationTE.setMandatory(true);
durationTE.setEnabled(showDurationTE);
durationTE.setVisible(showDurationTE);
durationTE.showError(false);
pauseTE = uifactory.addTextElement("pause", "config.dates.pause", 5, "00:00", formLayout);
pauseTE.setDisplaySize(5);
pauseTE.setRegexMatchCheck("\\d{1,2}:\\d\\d", "form.error.format");
pauseTE.setExampleKey("config.dates.pause.example", null);
pauseTE.setNotEmptyCheck("form.error.notempty");
pauseTE.setMandatory(true);
pauseTE.setEnabled(showPauseTE);
pauseTE.setVisible(showPauseTE);
retakeTE = uifactory.addTextElement("retake", "config.dates.retakes", 4, "1", formLayout);
retakeTE.setDisplaySize(4);
retakeTE.setRegexMatchCheck("^[1-9][0-9]*", "form.error.format");
retakeTE.setMandatory(true);
retakeTE.setNotEmptyCheck("form.error.notempty");
retakeTE.setEnabled(showRetakeTE);
retakeTE.setVisible(showRetakeTE);
beginDateChooser = uifactory.addDateChooser("begin", "config.dates.begin", null, formLayout);
beginDateChooser.setNotEmptyCheck("form.error.notempty");
beginDateChooser.setValidDateCheck("form.error.date");
beginDateChooser.setMandatory(true);
beginDateChooser.setDisplaySize(20);
beginDateChooser.setDateChooserTimeEnabled(true);
beginDateChooser.setExampleKey("config.dates.begin.example", null);
beginDateChooser.setEnabled(showBeginDateChooser);
beginDateChooser.setVisible(showBeginDateChooser);
beginDateChooser.setDate(new Date());
beginDateChooser.showError(false);
participantsTE = uifactory.addTextElement("participants", "config.dates.participants", 4, "", formLayout);
participantsTE.setDisplaySize(4);
if (layout == CREATE_DATES_LAYOUT) {
participantsTE.setRegexMatchCheck("^[1-9][0-9]*", "form.error.format");
participantsTE.setNotEmptyCheck("form.error.notempty");
participantsTE.setMandatory(true);
} else {
participantsTE.setRegexMatchCheck("(^[1-9][0-9]*)?$", "form.error.format");
participantsTE.setMandatory(false);
}
participantsTE.showError(false);
moveTE = uifactory.addTextElement("move", "config.dates.move", 6, "+00:00", formLayout);
moveTE.setDisplaySize(6);
moveTE.setRegexMatchCheck("[-+]\\d\\d:\\d\\d", "form.error.format");
moveTE.setNotEmptyCheck("form.error.notempty");
moveTE.setExampleKey("config.dates.move.example", null);
moveTE.setMandatory(true);
moveTE.setEnabled(showMoveTE);
moveTE.setVisible(showMoveTE);
moveTE.showError(false);
if (layout == EDIT_SINGLE_DATE_LAYOUT || layout == EDIT_MULTIPLE_DATES_LAYOUT)
submitBtn = new FormSubmit("submitBtn", "config.dates.save");
else
submitBtn = new FormSubmit("submitBtn", "dates.table.edit.save");
formLayout.add(submitBtn);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit in project openolat by klemens.
the class AdobeEditForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// meeting options
String[] accessKeys = new String[] { OPTION_OPEN_MEETING, OPTION_START_MEETING };
String[] accessVals = new String[] { translate(OPTION_OPEN_MEETING), translate(OPTION_START_MEETING) };
multiSelectOptions = uifactory.addCheckboxesVertical("vc.access", "vc.access.label", formLayout, accessKeys, accessVals, 1);
multiSelectOptions.select(OPTION_START_MEETING, !config.isGuestStartMeetingAllowed());
multiSelectOptions.select(OPTION_OPEN_MEETING, !config.isGuestAccessAllowed());
multiSelectOptions.setVisible(showOptions);
multiSelectOptions.addActionListener(FormEvent.ONCHANGE);
multiSelectOptions.showLabel(false);
submit = new FormSubmit("subm", "submit");
formLayout.add(submit);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit in project openolat by klemens.
the class WimbaEditForm method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// options
String[] optionKeys = new String[] { OPTION_GUEST_ACCESS };
String[] optionVals = new String[] { translate(OPTION_GUEST_ACCESS) };
multiSelectOptions = uifactory.addCheckboxesVertical("vc.options", "vc.options.label", formLayout, optionKeys, optionVals, 1);
multiSelectOptions.select(OPTION_GUEST_ACCESS, config.isGuestAccessAllowed());
multiSelectOptions.showLabel(false);
submit = new FormSubmit("subm", "submit");
formLayout.add(submit);
}
Aggregations