From dcb8271b50b9d76dd9c56af1f1621ed39072b229 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 25 Jan 2017 09:23:09 +0200 Subject: Allow distinct configurable filter and wrapped filter types (#8322) * Allow distinct configurable filter and wrapped filter types This enables implementing the use case that was already described towards the end of datamodel-providers.asciidoc. Also swaps the order of the callback type parameters to make all three match the order of the ConfigurableFilterDataProvider type parameters. --- documentation/datamodel/datamodel-providers.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'documentation/datamodel') diff --git a/documentation/datamodel/datamodel-providers.asciidoc b/documentation/datamodel/datamodel-providers.asciidoc index 35d47db4f9..6b5fea2275 100644 --- a/documentation/datamodel/datamodel-providers.asciidoc +++ b/documentation/datamodel/datamodel-providers.asciidoc @@ -402,7 +402,7 @@ DataProvider> personProvider = getPersonProvider(); ConfigurableFilterDataProvider> wrapper = personProvider.withConfigurableFilter( - (Set configuredFilters, String queryFilter) -> { + (String queryFilter, Set configuredFilters) -> { Set combinedFilters = new HashSet<>(); combinedFilters.addAll(configuredFilters); combinedFilters.add(queryFilter); @@ -529,7 +529,8 @@ everythingConfigurable.setFilter( // For use with ComboBox and separate department filtering ConfigurableDataProvider mixed = dataProvider.withConfigurableFilter( - (department, filterText) -> { + // Can be shortened as PersonFilter::new + (filterText, department) -> { return new PersonFilter(filterText, department); } ); -- cgit v1.2.3