diff options
author | caalador <mikael.grankvist@gmail.com> | 2017-02-02 14:39:52 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-02-02 14:39:52 +0200 |
commit | ab207e8bbeb6f3bf5b6a45e01ca5a4fb0e0c4f6a (patch) | |
tree | 6075d48e39f046eb27a059d7ab654687f6730d68 | |
parent | 0bbee6f4e2581200cfa118579e3ae20c97044560 (diff) | |
download | vaadin-framework-ab207e8bbeb6f3bf5b6a45e01ca5a4fb0e0c4f6a.tar.gz vaadin-framework-ab207e8bbeb6f3bf5b6a45e01ca5a4fb0e0c4f6a.zip |
Add default getEmptyValue for MultiSelect interface (#8420) (#8421)8.0.0.beta2
* Add deafult getEmptyValue for MultiSelect interface (#8420)
Added an default implementation for getEmptyValue to the
MultiSelect interface.
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java | 5 | ||||
-rw-r--r-- | server/src/main/java/com/vaadin/ui/MultiSelect.java | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java index 9947067288..a0c8fd2225 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMultiSelect.java @@ -216,11 +216,6 @@ public abstract class AbstractMultiSelect<T> extends AbstractListing<T> updateSelection(copy, new LinkedHashSet<>(getSelectedItems())); } - @Override - public Set<T> getEmptyValue() { - return Collections.emptySet(); - } - /** * Adds a value change listener. The listener is called when the selection * set of this multi select is changed either by the user or diff --git a/server/src/main/java/com/vaadin/ui/MultiSelect.java b/server/src/main/java/com/vaadin/ui/MultiSelect.java index 6519921c88..3c56a22da1 100644 --- a/server/src/main/java/com/vaadin/ui/MultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/MultiSelect.java @@ -136,4 +136,15 @@ public interface MultiSelect<T> extends HasValue<Set<T>>, Serializable { */ public Registration addSelectionListener( MultiSelectionListener<T> listener); + + /** + * MultiSelect empty value should always be an empty set by default and not + * {@code null}. + * + * @return An empty set, not {@code null} + */ + public default Set<T> getEmptyValue() { + return Collections.emptySet(); + } + } |