diff options
author | Leif Åstrand <legioth@gmail.com> | 2017-01-13 10:08:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-13 10:08:01 +0200 |
commit | 0c471fbab5149b2bf7851631706cef2fda29a1d9 (patch) | |
tree | 7468dd851162b61d3dfdffea87b147350f10965e /uitest | |
parent | 253a61c1957941759deff87518989a71c30fc301 (diff) | |
download | vaadin-framework-0c471fbab5149b2bf7851631706cef2fda29a1d9.tar.gz vaadin-framework-0c471fbab5149b2bf7851631706cef2fda29a1d9.zip |
Replace Listing with HasDataProvider and HasFilterableDataProvider (#8122)
* Replace Listing with HasDataProvider and HasFilterableDataProvider
The type parameters of the Listing interface does in practice mean that
it isn't useful for anything. This patch replaces that interface with
separate types for components that require filterable data providers and
components that support any kind of data provider.
The setItem methods are extracted to a common interface that is also
directly implemented by AbstractListing.
Diffstat (limited to 'uitest')
5 files changed, 8 insertions, 11 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractListingFocusBlurTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractListingFocusBlurTest.java index 7e35bbb386..1d7bd7ac0b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractListingFocusBlurTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractListingFocusBlurTest.java @@ -21,7 +21,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import com.googlecode.gentyref.GenericTypeReflector; -import com.vaadin.data.Listing; import com.vaadin.event.FieldEvents.BlurNotifier; import com.vaadin.event.FieldEvents.FocusNotifier; import com.vaadin.server.VaadinRequest; @@ -31,7 +30,7 @@ import com.vaadin.ui.AbstractListing; * @author Vaadin Ltd * */ -public abstract class AbstractListingFocusBlurTest<T extends AbstractListing<Integer> & FocusNotifier & BlurNotifier & Listing<Integer, ?>> +public abstract class AbstractListingFocusBlurTest<T extends AbstractListing<Integer> & FocusNotifier & BlurNotifier> extends AbstractTestUIWithLog { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java index 8a46738e5d..9d2ca4f6ea 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java @@ -4,12 +4,11 @@ import java.util.LinkedHashMap; import java.util.stream.IntStream; import com.vaadin.annotations.Widgetset; -import com.vaadin.data.Listing; import com.vaadin.tests.components.AbstractComponentTest; import com.vaadin.ui.AbstractListing; @Widgetset("com.vaadin.DefaultWidgetSet") -public abstract class AbstractListingTestUI<T extends AbstractListing<Object> & Listing<Object, ?>> +public abstract class AbstractListingTestUI<T extends AbstractListing<Object>> extends AbstractComponentTest<T> { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java index 2417bdfcde..c405a2af52 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java @@ -5,11 +5,10 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; -import com.vaadin.data.Listing; import com.vaadin.ui.AbstractMultiSelect; import com.vaadin.ui.ItemCaptionGenerator; -public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMultiSelect<Object> & Listing<Object, ?>> +public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMultiSelect<Object>> extends AbstractListingTestUI<MULTISELECT> { protected final String selectionCategory = "Selection"; @@ -33,7 +32,8 @@ public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMult "None", (abstractMultiSelect, captionGenerator, data) -> { abstractMultiSelect .setItemCaptionGenerator(captionGenerator); - abstractMultiSelect.getDataProvider().refreshAll(); + abstractMultiSelect.getDataCommunicator().getDataProvider() + .refreshAll(); }, true); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java index 3b51b0985c..4c773283ec 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java @@ -17,10 +17,9 @@ package com.vaadin.tests.components.abstractlisting; import java.util.LinkedHashMap; -import com.vaadin.data.Listing; import com.vaadin.ui.AbstractSingleSelect; -public abstract class AbstractSingleSelectTestUI<T extends AbstractSingleSelect<Object> & Listing<Object, ?>> +public abstract class AbstractSingleSelectTestUI<T extends AbstractSingleSelect<Object>> extends AbstractListingTestUI<T> { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/data/DummyData.java b/uitest/src/main/java/com/vaadin/tests/data/DummyData.java index ed13a2300e..f31348863a 100644 --- a/uitest/src/main/java/com/vaadin/tests/data/DummyData.java +++ b/uitest/src/main/java/com/vaadin/tests/data/DummyData.java @@ -8,7 +8,7 @@ import java.util.Optional; import java.util.stream.Stream; import com.vaadin.annotations.Widgetset; -import com.vaadin.data.Listing; +import com.vaadin.data.HasDataProvider; import com.vaadin.data.provider.DataProvider; import com.vaadin.data.provider.ListDataProvider; import com.vaadin.data.provider.Query; @@ -45,7 +45,7 @@ public class DummyData extends AbstractTestUIWithLog { * shown as bold text. */ public static class DummyComponent extends AbstractSingleSelect<String> - implements Listing<String, DataProvider<String, ?>> { + implements HasDataProvider<String> { private String selected; |