diff --git a/src/main/java/org/olat/core/gui/components/table/TableController.java b/src/main/java/org/olat/core/gui/components/table/TableController.java index ea2d9193e3741eea3fcb7da91ad546a6aac12105..a8ba4ff845fd7097b80f18da0d8ae8e9e3a98acd 100644 --- a/src/main/java/org/olat/core/gui/components/table/TableController.java +++ b/src/main/java/org/olat/core/gui/components/table/TableController.java @@ -48,7 +48,6 @@ import org.olat.core.gui.control.generic.ajax.autocompletion.EntriesChosenEvent; import org.olat.core.gui.control.generic.ajax.autocompletion.ListProvider; import org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController; import org.olat.core.gui.media.MediaResource; -import org.olat.core.gui.translator.PackageTranslator; import org.olat.core.gui.translator.Translator; import org.olat.core.logging.AssertException; import org.olat.core.logging.OLog; @@ -136,7 +135,7 @@ public class TableController extends BasicController { private TablePrefs prefs; private TableGuiConfiguration tableConfig; - private List filters; + private List<ShortName> filters; private String filterTitle; private ShortName activeFilter; @@ -228,22 +227,22 @@ public class TableController extends BasicController { } if (tableTrans != null) { - setTranslator(new PackageTranslator(Util.getPackageName(TableController.class), ureq.getLocale(), tableTrans)); + setTranslator(Util.createPackageTranslator(TableController.class, ureq.getLocale(), tableTrans)); } - this.table = new Table(COMPONENT_TABLE_NAME, getTranslator()); - this.table.addListener(this); + table = new Table(COMPONENT_TABLE_NAME, getTranslator()); + table.addListener(this); // propagate table specific configuration to table, // rest of configuration is handled by this controller - this.table.setColumnMovingOffered(tableConfig.isColumnMovingOffered()); - this.table.setDisplayTableHeader(tableConfig.isDisplayTableHeader()); - this.table.setSelectedRowUnselectable(tableConfig.isSelectedRowUnselectable()); - this.table.setSortingEnabled(tableConfig.isSortingEnabled()); - this.table.setPageingEnabled(tableConfig.isPageingEnabled()); - this.table.setResultsPerPage(tableConfig.getResultsPerPage()); - this.table.setMultiSelect(tableConfig.isMultiSelect()); - this.table.enableShowAllLink(tableConfig.isShowAllLinkEnabled()); + table.setColumnMovingOffered(tableConfig.isColumnMovingOffered()); + table.setDisplayTableHeader(tableConfig.isDisplayTableHeader()); + table.setSelectedRowUnselectable(tableConfig.isSelectedRowUnselectable()); + table.setSortingEnabled(tableConfig.isSortingEnabled()); + table.setPageingEnabled(tableConfig.isPageingEnabled()); + table.setResultsPerPage(tableConfig.getResultsPerPage()); + table.setMultiSelect(tableConfig.isMultiSelect()); + table.enableShowAllLink(tableConfig.isShowAllLinkEnabled()); // table is embedded in a velocity page that renders the surrounding layout @@ -350,7 +349,7 @@ public class TableController extends BasicController { throw new AssertException("Filter size was ::" + filters.size() + " but requested filter was ::" + filterPosition); } // update new filter value - setActiveFilter((ShortName) filters.get(filterPosition)); + setActiveFilter(filters.get(filterPosition)); fireEvent(ureq, EVENT_FILTER_SELECTED); } } @@ -450,7 +449,7 @@ public class TableController extends BasicController { * filter is applied */ public ShortName getActiveFilter() { - return this.activeFilter; + return activeFilter; } /** @@ -459,10 +458,10 @@ public class TableController extends BasicController { */ public void setActiveFilter(final ShortName activeFilter) { this.activeFilter = activeFilter; - if (this.activeFilter == null) { - this.contentVc.contextPut(VC_VAR_SELECTED_FILTER_VALUE, CMD_FILTER_NOFILTER); + if (activeFilter == null) { + contentVc.contextPut(VC_VAR_SELECTED_FILTER_VALUE, CMD_FILTER_NOFILTER); } else { - this.contentVc.contextPut(VC_VAR_SELECTED_FILTER_VALUE, this.activeFilter.getShortName()); + contentVc.contextPut(VC_VAR_SELECTED_FILTER_VALUE, activeFilter); } } @@ -472,11 +471,11 @@ public class TableController extends BasicController { * @param filters List of TableFilter * @param activeFilter active TableFilter */ - public void setFilters(final List filters, final ShortName activeFilter) { + public void setFilters(final List<ShortName> filters, final ShortName activeFilter) { this.filters = filters; - this.contentVc.contextPut("hasFilters", filters == null ? Boolean.FALSE : Boolean.TRUE); - this.contentVc.contextPut("filters", filters); - this.contentVc.contextPut("filterTitle", filterTitle == null ? "" : filterTitle); + contentVc.contextPut("hasFilters", filters == null ? Boolean.FALSE : Boolean.TRUE); + contentVc.contextPut("filters", filters); + contentVc.contextPut("filterTitle", filterTitle == null ? "" : filterTitle); setActiveFilter(activeFilter); } @@ -524,7 +523,7 @@ public class TableController extends BasicController { if (!tablePrefsInitialized) { // first time if (prefs != null) { try { - List acolRefs = prefs.getActiveColumnsRef(); + List<Integer> acolRefs = prefs.getActiveColumnsRef(); table.updateConfiguredRows(acolRefs); } catch(IndexOutOfBoundsException ex) { // GUI prefs match not to table data model => reset prefs diff --git a/src/main/java/org/olat/core/gui/components/table/TablePrefs.java b/src/main/java/org/olat/core/gui/components/table/TablePrefs.java index 6cf447f613dd5a74e2123a513b2b1c70c685be30..2bb91d7189c2e0b29ab58ec91607828518bd9905 100644 --- a/src/main/java/org/olat/core/gui/components/table/TablePrefs.java +++ b/src/main/java/org/olat/core/gui/components/table/TablePrefs.java @@ -36,7 +36,7 @@ import java.util.List; * @author Felix Jost */ public class TablePrefs { - private List activeColumnsRef; // list of Integers + private List<Integer> activeColumnsRef; // list of Integers public TablePrefs() { // keep default constructor for xstreamhelper @@ -45,14 +45,14 @@ public class TablePrefs { /** * @return Returns the activeColumnsRef. */ - public List getActiveColumnsRef() { + public List<Integer> getActiveColumnsRef() { return activeColumnsRef; } /** * @param activeColumnsRef The activeColumnsRef to set. */ - public void setActiveColumnsRef(final List activeColumnsRef) { + public void setActiveColumnsRef(final List<Integer> activeColumnsRef) { this.activeColumnsRef = activeColumnsRef; } } diff --git a/src/main/java/org/olat/core/gui/components/table/_content/tablelayout.html b/src/main/java/org/olat/core/gui/components/table/_content/tablelayout.html index 2670a03a0d313ad829561befc9e63f8f9a7dc25b..b007466385f0bb1914cd3375aa86cfcc564f8657 100644 --- a/src/main/java/org/olat/core/gui/components/table/_content/tablelayout.html +++ b/src/main/java/org/olat/core/gui/components/table/_content/tablelayout.html @@ -14,7 +14,7 @@ <option value="$r.commandURI("cmd.filter.nofilter")">$noFilterOption</option> #end #foreach ($filter in $filters) - #if ($filter.getShortName() == $selectedFilterValue) + #if ($filter == $selectedFilterValue) #set ($selected="selected") #else #set ($selected="") diff --git a/src/main/java/org/olat/repository/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/repository/_i18n/LocalStrings_fr.properties index a8382f69a4acd9bb9525ea2e3410794df6b0577b..d7d1b78ee6613c0260400ba81668b88ad1c2aa3d 100644 --- a/src/main/java/org/olat/repository/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/repository/_i18n/LocalStrings_fr.properties @@ -380,7 +380,7 @@ search.blog=Blog search.catalog=Catalogue search.course=Cours search.cp=Contenus didactiques CP -search.filter.showAll=tout montrer +search.filter.showAll=Tout montrer search.filter.type=Type search.generic=Masque de recherche search.glossary=Glossaire