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