diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-03-16 10:32:22 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-12 14:58:11 +0300 |
commit | 2df1b373aae547275b566fef957322af0b61b427 (patch) | |
tree | 74085469535986808d5111f5164e1aaf3c4a38d9 /uitest | |
parent | c4f8524ea881e6a946ac9e9e1911fd2873f484e9 (diff) | |
download | vaadin-framework-2df1b373aae547275b566fef957322af0b61b427.tar.gz vaadin-framework-2df1b373aae547275b566fef957322af0b61b427.zip |
Make all selected rows draggable (#8746)
Fixes #8397
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java index 32c147f15f..a6036acac8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java @@ -16,13 +16,16 @@ package com.vaadin.tests.components.grid; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.stream.IntStream; +import com.vaadin.annotations.Widgetset; import com.vaadin.event.dnd.DropTargetExtension; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.grid.GridDragSourceExtensionState; import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.ComboBox; import com.vaadin.ui.Grid; import com.vaadin.ui.GridDragSourceExtension; import com.vaadin.ui.HorizontalLayout; @@ -32,6 +35,7 @@ import com.vaadin.ui.Layout; import elemental.json.Json; import elemental.json.JsonObject; +@Widgetset("com.vaadin.DefaultWidgetSet") public class GridDragAndDrop extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { @@ -62,7 +66,17 @@ public class GridDragAndDrop extends AbstractTestUIWithLog { Layout layout = new HorizontalLayout(); layout.addComponents(dragSourceComponent, dropTargetComponent); - addComponent(layout); + // Selection mode combo box + ComboBox<Grid.SelectionMode> selectionModeSwitch = new ComboBox<>( + "Change selection mode"); + selectionModeSwitch.setItems(Arrays.asList(Grid.SelectionMode.SINGLE, + Grid.SelectionMode.MULTI)); + selectionModeSwitch.setEmptySelectionAllowed(false); + selectionModeSwitch.addValueChangeListener(event -> dragSourceComponent + .setSelectionMode(event.getValue())); + selectionModeSwitch.setSelectedItem(Grid.SelectionMode.SINGLE); + + addComponents(selectionModeSwitch, layout); } private List<Bean> createItems(int num) { |