Search in sources :

Example 41 with FormLinkImpl

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

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 42 with FormLinkImpl

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

the class UserInterestsElement method setRootForm.

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

Example 43 with FormLinkImpl

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

the class ChecklistEditCheckpointsController method initForm.

@Override
protected void initForm(FormItemContainer fic, Controller controller, UserRequest ureq) {
    if (titleContainer != null)
        fic.remove(titleContainer);
    if (buttonContainer != null)
        fic.remove(buttonContainer);
    titleContainer = FormLayoutContainer.createCustomFormLayout("titleLayout", getTranslator(), velocity_root + "/edit.html");
    fic.add(titleContainer);
    // create gui elements for all checkpoints
    loadCheckpointInVC();
    addButton = new FormLinkImpl("add" + counter, "add" + counter, "cl.table.add", Link.BUTTON_SMALL);
    addButton.setUserObject(checklist.getCheckpointsSorted(checkpointComparator).get(checklist.getCheckpoints().size() - 1));
    titleContainer.add(addButton);
    titleContainer.contextPut("checkpoints", checkpointsInVc);
    titleContainer.contextPut("titleInputList", titleInputList);
    titleContainer.contextPut("descriptionInputList", descriptionInputList);
    titleContainer.contextPut("modeInputList", modeInputList);
    titleContainer.contextPut("addButton", addButton);
    titleContainer.contextPut("delButtonList", delButtonList);
    buttonContainer = FormLayoutContainer.createButtonLayout("buttonLayout", getTranslator());
    fic.add(buttonContainer);
    uifactory.addFormCancelButton("cancel", buttonContainer, ureq, getWindowControl());
    uifactory.addFormSubmitButton("subm", submitKey, buttonContainer);
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 44 with FormLinkImpl

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

the class FlexiTableElementImpl method setExtendedSearch.

@Override
public void setExtendedSearch(ExtendedFlexiTableSearchController controller) {
    extendedSearchCtrl = controller;
    if (extendedSearchCtrl != null) {
        extendedSearchCtrl.addControllerListener(this);
        String dispatchId = component.getDispatchID();
        extendedSearchButton = new FormLinkImpl(dispatchId + "_extSearchButton", "rExtSearchButton", "extsearch", Link.BUTTON);
        extendedSearchButton.setTranslator(translator);
        extendedSearchButton.setIconLeftCSS("o_icon o_icon_search");
        components.put("rExtSearchB", extendedSearchButton);
        rootFormAvailable(extendedSearchButton);
        extendedSearchButton.setElementCssClass("o_sel_flexi_extendedsearch");
        components.put("rExtSearchCmp", controller.getInitialFormItem());
    }
}
Also used : FormLinkImpl(org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl)

Example 45 with FormLinkImpl

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

the class FlexiTableElementImpl method setAvailableRendererTypes.

@Override
public void setAvailableRendererTypes(FlexiTableRendererType... rendererTypes) {
    this.availableRendererType = rendererTypes;
    if (rendererTypes != null && rendererTypes.length > 1) {
        String dispatchId = component.getDispatchID();
        // custom
        customTypeButton = new FormLinkImpl(dispatchId + "_customRTypeButton", "rCustomRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
        customTypeButton.setTranslator(translator);
        customTypeButton.setIconLeftCSS("o_icon o_icon_table_custom o_icon-lg");
        customTypeButton.setActive(FlexiTableRendererType.custom == rendererType);
        components.put("rTypeCustom", customTypeButton);
        // classic tables
        classicTypeButton = new FormLinkImpl(dispatchId + "_classicRTypeButton", "rClassicRTypeButton", "", Link.BUTTON + Link.NONTRANSLATED);
        classicTypeButton.setTranslator(translator);
        classicTypeButton.setIconLeftCSS("o_icon o_icon_table o_icon-lg");
        classicTypeButton.setActive(FlexiTableRendererType.classic == rendererType);
        components.put("rTypeClassic", classicTypeButton);
        if (getRootForm() != null) {
            rootFormAvailable(customTypeButton);
            rootFormAvailable(classicTypeButton);
        }
    }
}
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