aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2016-09-08 22:49:54 +0300
committerArtur Signell <artur@vaadin.com>2016-09-12 09:36:08 +0000
commit8588b4a7759dff9a3862079d516f5201be55982c (patch)
tree0dbfb02ac867e7c565358b40f1e06f8ecdb38f96 /server/src/main/java/com
parentf5104e34f3167fa2bf05e93272f5b71c15d00071 (diff)
downloadvaadin-framework-8588b4a7759dff9a3862079d516f5201be55982c.tar.gz
vaadin-framework-8588b4a7759dff9a3862079d516f5201be55982c.zip
Add selection support to NativeSelect
Change-Id: Iabe563852150a7d690f6e2edaa40253d03127881
Diffstat (limited to 'server/src/main/java/com')
-rw-r--r--server/src/main/java/com/vaadin/ui/NativeSelect.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/server/src/main/java/com/vaadin/ui/NativeSelect.java b/server/src/main/java/com/vaadin/ui/NativeSelect.java
index 9a400a1a01..be4cbc5e12 100644
--- a/server/src/main/java/com/vaadin/ui/NativeSelect.java
+++ b/server/src/main/java/com/vaadin/ui/NativeSelect.java
@@ -17,12 +17,9 @@
package com.vaadin.ui;
import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
import com.vaadin.server.data.DataSource;
import com.vaadin.shared.data.DataCommunicatorConstants;
-import com.vaadin.shared.data.selection.SelectionModel;
import com.vaadin.shared.ui.nativeselect.NativeSelectState;
/**
@@ -37,7 +34,7 @@ import com.vaadin.shared.ui.nativeselect.NativeSelectState;
*
* @see com.vaadin.ui.ComboBox
*/
-public class NativeSelect<T> extends AbstractListing<T, SelectionModel<T>> {
+public class NativeSelect<T> extends AbstractSingleSelect<T> {
/**
* Creates a new {@code NativeSelect} with an empty caption and no items.
@@ -46,21 +43,7 @@ public class NativeSelect<T> extends AbstractListing<T, SelectionModel<T>> {
addDataGenerator((item, json) -> json.put(
DataCommunicatorConstants.DATA, String.valueOf(item)));
- setSelectionModel(new SelectionModel<T>() {
-
- @Override
- public Set<T> getSelectedItems() {
- return Collections.emptySet();
- }
-
- @Override
- public void select(T item) {
- }
-
- @Override
- public void deselect(T item) {
- }
- });
+ setSelectionModel(new SimpleSingleSelection());
}
/**