Search in sources :

Example 11 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project openolat by klemens.

the class SmsPhoneElement method setRootForm.

@Override
public void setRootForm(Form rootForm) {
    String dispatchId = component.getDispatchID();
    editLink = new FormLinkImpl(dispatchId + "_editSmsButton", "editSms", "edit", Link.BUTTON);
    editLink.setDomReplacementWrapperRequired(false);
    editLink.setTranslator(getTranslator());
    editLink.setIconLeftCSS("o_icon o_icon_edit");
    removeLink = new FormLinkImpl(dispatchId + "_removeSmsButton", "removeSms", "remove", Link.BUTTON);
    removeLink.setDomReplacementWrapperRequired(false);
    removeLink.setTranslator(getTranslator());
    removeLink.setIconLeftCSS("o_icon o_icon_delete");
    super.setRootForm(rootForm);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 12 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project openolat by klemens.

the class StepsMainRunController method initForm.

/*
	 * (non-Javadoc)
	 * 
	 * @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) {
    formLayout.add("stepLinks", stepTitleLinks);
    // steps/wizard navigation .. as start most of buttons are disabled
    // they must be enabled by the first step according to its rules
    // cancel button is not possible to disable
    prevButton = new FormLinkImpl("back");
    prevButton.setCustomEnabledLinkCSS("btn btn-default o_wizard_button_prev");
    prevButton.setCustomDisabledLinkCSS("btn btn-default o_wizard_button_prev");
    prevButton.setIconLeftCSS("o_icon o_icon_previous_step o_icon-fw");
    nextButton = new FormLinkImpl("next");
    nextButton.setCustomEnabledLinkCSS("btn btn-default o_wizard_button_next");
    nextButton.setCustomDisabledLinkCSS("btn btn-default o_wizard_button_next");
    nextButton.setIconRightCSS("o_icon o_icon_next_step o_icon-fw");
    finishButton = new FormLinkImpl("finish");
    finishButton.setCustomEnabledLinkCSS("btn btn-default o_wizard_button_finish");
    finishButton.setCustomDisabledLinkCSS("btn btn-default o_wizard_button_finish");
    cancelButton = new FormLinkImpl("cancel");
    cancelButton.setCustomEnabledLinkCSS("btn btn-default o_wizard_button_cancel");
    cancelButton.setCustomDisabledLinkCSS("btn btn-default o_wizard_button_cancel");
    closeLink = new FormLinkImpl("closeIcon", "close", "", Link.NONTRANSLATED);
    closeLink.setIconLeftCSS("o_icon o_icon_close");
    formLayout.add(prevButton);
    formLayout.add(nextButton);
    formLayout.add(finishButton);
    formLayout.add(cancelButton);
    formLayout.add(closeLink);
    // add all step titles, but disabled.
    Step tmp = startStep;
    do {
        FormItem title = tmp.getStepTitle();
        title.setEnabled(false);
        stepTitleLinks.add(title);
        tmp = tmp.nextStep();
    } while (tmp != Step.NOSTEP);
    // init buttons and the like
    // start with -1 to be on zero after calling
    currentStepIndex = -1;
    // update current step index to velocity
    flc.contextPut("currentStep", currentStepIndex + 1);
    // next step the first time
    addNextStep(startStep.getStepController(ureq, getWindowControl(), this.stepsContext, this.mainForm), startStep);
}
Also used : FormItem(org.olat.core.gui.components.form.flexible.FormItem) FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 13 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project openolat by klemens.

the class BasicStep method getStepTitle.

/**
 * generates FormLink with defined i18nKey, otherwise override and provide
 * your own FormItem here.
 * @see org.olat.core.gui.control.generic.wizard.Step#getStepTitle()
 */
public FormItem getStepTitle() {
    if (i18nStepTitle == null) {
        throw new AssertException("no i18n key set for step title, or getStepTitle() not overridden.");
    }
    FormLink fl;
    if (i18nArguments != null && i18nArguments.length > 0) {
        String title = this.getTranslator().translate(i18nStepTitle, i18nArguments);
        fl = new FormLinkImpl(i18nStepTitle, null, title, Link.FLEXIBLEFORMLNK + Link.NONTRANSLATED);
    } else {
        fl = new FormLinkImpl(i18nStepTitle, i18nStepTitle);
    }
    fl.setTranslator(getTranslator());
    return fl;
}
Also used : AssertException(org.olat.core.logging.AssertException) FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 14 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project openolat by klemens.

the class FlexiTableElementImpl method setSearchEnabled.

@Override
public void setSearchEnabled(ListProvider autoCompleteProvider, UserSession usess) {
    searchEnabled = true;
    String dispatchId = component.getDispatchID();
    searchFieldEl = new AutoCompleterImpl(dispatchId + "_searchField", "search");
    searchFieldEl.showLabel(false);
    searchFieldEl.getComponent().addListener(this);
    ((AutoCompleterImpl) searchFieldEl).setListProvider(autoCompleteProvider, usess);
    components.put("rSearch", searchFieldEl);
    searchButton = new FormLinkImpl(dispatchId + "_searchButton", "rSearchButton", "search", Link.BUTTON);
    searchButton.setTranslator(translator);
    searchButton.setIconLeftCSS("o_icon o_icon_search");
    components.put("rSearchB", searchButton);
    rootFormAvailable(searchFieldEl);
    rootFormAvailable(searchButton);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl) AutoCompleterImpl(org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)

Example 15 with FormLinkImpl

use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project openolat by klemens.

the class FlexiTableElementImpl method setExportEnabled.

@Override
public void setExportEnabled(boolean enabled) {
    this.exportEnabled = enabled;
    if (exportEnabled) {
        exportButton = null;
        String dispatchId = component.getDispatchID();
        exportButton = new FormLinkImpl(dispatchId + "_exportButton", "rExportButton", "", Link.BUTTON | Link.NONTRANSLATED);
        exportButton.setTranslator(translator);
        exportButton.setIconLeftCSS("o_icon o_icon_download");
        components.put("rExport", exportButton);
        rootFormAvailable(exportButton);
    } else {
        exportButton = null;
    }
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Aggregations

FormLinkImpl (org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)52 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)12 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)8 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)6 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 FormItem (org.olat.core.gui.components.form.flexible.FormItem)4 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)4 BusinessGroupShort (org.olat.group.BusinessGroupShort)4 BGArea (org.olat.group.area.BGArea)4 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Locale (java.util.Locale)2 TimeZone (java.util.TimeZone)2 ValidationError (org.olat.core.gui.components.form.ValidationError)2 DateChooser (org.olat.core.gui.components.form.flexible.elements.DateChooser)2 AutoCompleterImpl (org.olat.core.gui.components.form.flexible.impl.elements.AutoCompleterImpl)2 ItemValidatorProvider (org.olat.core.gui.components.form.flexible.impl.elements.ItemValidatorProvider)2