/**
   * org.olat.presentation.framework.control.Controller,
   * org.olat.presentation.framework.UserRequest)
   */
  @Override
  protected void initForm(
      final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) {
    emailOrUsername =
        uifactory.addTextElement("emailOrUsername", "email.or.username", -1, null, formLayout);
    emailOrUsername.setMandatory(true);
    emailOrUsername.setNotEmptyCheck("email.or.username.maynotbeempty");

    final FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    this.flc.add(buttonLayout);
    uifactory.addFormSubmitButton("submit", buttonLayout);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
  }
  /**
   * org.olat.presentation.framework.control.Controller,
   * org.olat.presentation.framework.UserRequest)
   */
  @Override
  @SuppressWarnings("unused")
  // listener is never used because listener == this!
  protected void initForm(
      final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) {
    setFormTitle("guidemo_flexi_form_advanced");
    setFormDescription("advanced_form.description");
    // setFormContextHelp(this.getClass().getPackage().getName(),
    // "advancedFormHelp", "advanced_form.description");
    // Mandatory and read-only text fields

    this.addTextFields(formLayout);

    // More form items: Date, link and file selector
    this.addDateLinkAndFileItems(formLayout);

    // Separator with line
    uifactory.addSpacerElement("spacer", formLayout, false);

    // Single and multible selections (radio buttons and checkboxes)
    this.addSelections(formLayout);

    // Separator without line
    uifactory.addSpacerElement("spacernoline", formLayout, true);

    // Sublayout (shown if no is selected)
    this.addSublayout(formLayout);

    // Here's a text area
    uifactory.addTextAreaElement("guidemo.form.textarea", 0, 2, null, formLayout);

    // Add some rich text elements
    richTextElement =
        uifactory.addRichTextElementForStringData(
            "guidemo.form.richtext.simple",
            "guidemo.form.richtext.simple",
            "click <i>to</i> <b>edit</b>. This one has an event listener and an <b>external menu with auto hide</b>",
            -1,
            -1,
            true,
            false,
            null,
            null,
            formLayout,
            ureq.getUserSession(),
            getWindowControl());
    // richTextElement.addActionListener(this, FormEvent.ONCHANGE);

    richTextElement2 =
        uifactory.addRichTextElementForStringData(
            "guidemo.form.richtext.simple2",
            null,
            "one <i>with</i> <b>height</b> and <span style='color:red'>no</span> event listener and an <b>internal</b> menu",
            10,
            40,
            false,
            true,
            null,
            null,
            formLayout,
            ureq.getUserSession(),
            getWindowControl());

    disabledRichTextElement =
        uifactory.addRichTextElementForStringData(
            "guidemo.form.richtext.simple3",
            "guidemo.form.richtext.simple",
            "this <i>is</i> <b>disabled</b>",
            -1,
            -1,
            true,
            false,
            null,
            null,
            formLayout,
            ureq.getUserSession(),
            getWindowControl());
    disabledRichTextElement.setEnabled(false);

    // Button layout
    final FormLayoutContainer buttonLayout =
        FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);

    // Submit and cancel buttons (without effect)
    uifactory.addFormSubmitButton("advanced_form.submit", buttonLayout);
    uifactory.addFormLink("advanced_form.cancel", buttonLayout, Link.BUTTON);
  }