use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.
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());
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.
the class FlexiTableElementImpl method setExtendedFilterButton.
@Override
public void setExtendedFilterButton(String label, List<FlexiTableFilter> extendedFilters) {
if (StringHelper.containsNonWhitespace(label) && extendedFilters != null && extendedFilters.size() > 0) {
this.extendedFilters = extendedFilters;
String dispatchId = component.getDispatchID();
extendedFilterButton = new FormLinkImpl(dispatchId + "_extFilterButton", "rExtFilterButton", "extfilter", Link.BUTTON | Link.NONTRANSLATED);
extendedFilterButton.setI18nKey(label);
extendedFilterButton.setTranslator(translator);
extendedFilterButton.setIconLeftCSS("o_icon o_icon_filter");
components.put("rExtFilterB", extendedFilterButton);
rootFormAvailable(extendedFilterButton);
extendedFilterButton.setElementCssClass("o_sel_flexi_extendedsearch");
} else {
extendedFilterButton = null;
extendedFilters = null;
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.
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);
}
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class TranslationToolStartCrumbController method initExistingItemsElements.
private void initExistingItemsElements(FormUIFactory formFactory, FormItemContainer formLayout, String[] bundlesKeys, String[] bundlesValues) {
// Add existing bundles selector
existingBundlesSelection = formFactory.addDropdownSingleselect("existingBundlesSelection", this.flc, bundlesKeys, bundlesValues, null);
existingBundlesSelection.addActionListener(FormEvent.ONCHANGE);
existingBundlesSelection.select(ALL_BUNDLES_IDENTIFYER, true);
// Add existing bundles children switch
String[] existingBundlesInclude = new String[] { translate("generic.limit.bundles.includeChildren") };
existingBundlesIncludeBundlesChildrenSwitch = formFactory.addCheckboxesHorizontal("existingBundlesIncludeBundlesChildrenSwitch", null, flc, new String[] { KEYS_ENABLED }, // disabled label by setting i18nLabel to null
existingBundlesInclude);
existingBundlesIncludeBundlesChildrenSwitch.select(KEYS_ENABLED, true);
existingBundlesIncludeBundlesChildrenSwitch.addActionListener(FormEvent.ONCLICK);
formLayout.add(existingBundlesIncludeBundlesChildrenSwitch);
existingBundlesIncludeBundlesChildrenSwitch.setEnabled(false);
// Add priority sort switch
String[] existingBundlespPrio = new String[] { translate("generic.sort.by.priority") };
existingBundlesPrioritySortSwitch = formFactory.addCheckboxesHorizontal("existingBundlesPrioritySortSwitch", null, flc, new String[] { KEYS_ENABLED }, // disabled label by setting i18nLabel to null
existingBundlespPrio);
existingBundlesPrioritySortSwitch.select(KEYS_ENABLED, true);
existingBundlesPrioritySortSwitch.addActionListener(FormEvent.ONCLICK);
formLayout.add(existingBundlesPrioritySortSwitch);
// Add button to trigger existing keys search
existingListButton = new FormLinkImpl("existingListButton", "existingListButton", "generic.listButton", Link.BUTTON);
formLayout.add(existingListButton);
existingTranslateButton = new FormLinkImpl("existingTranslateButton", "existingTranslateButton", "generic.translateButton", Link.BUTTON);
formLayout.add(existingTranslateButton);
}
Aggregations