From 6ecef502864ed201b468a68c00676beb401f21c7 Mon Sep 17 00:00:00 2001 From: Adam Wagner Date: Mon, 3 Jul 2017 13:36:17 +0200 Subject: Add criteria API to make it easier to set acceptance criteria for drag and drop (#9605) Fixes #9600 --- .../vaadin/tests/dnd/DragAndDropCardShuffle.java | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'uitest') diff --git a/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropCardShuffle.java b/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropCardShuffle.java index 493b57226e..8f04ed1835 100644 --- a/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropCardShuffle.java +++ b/uitest/src/main/java/com/vaadin/tests/dnd/DragAndDropCardShuffle.java @@ -22,6 +22,7 @@ import com.vaadin.annotations.Theme; import com.vaadin.annotations.Widgetset; import com.vaadin.server.Page; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.dnd.criteria.ComparisonOperator; import com.vaadin.shared.ui.dnd.DropEffect; import com.vaadin.shared.ui.dnd.EffectAllowed; import com.vaadin.tests.components.AbstractTestUIWithLog; @@ -86,20 +87,20 @@ public class DragAndDropCardShuffle extends AbstractTestUIWithLog { // Create UI and add extensions ace.setStyleName("card"); - addDragSourceExtension(ace); - addDropTargetExtension(ace); + addDragSourceExtension(ace, 14); + addDropTargetExtension(ace, 14); jack.setStyleName("card"); - addDragSourceExtension(jack); - addDropTargetExtension(jack); + addDragSourceExtension(jack, 11); + addDropTargetExtension(jack, 11); queen.setStyleName("card"); - addDragSourceExtension(queen); - addDropTargetExtension(queen); + addDragSourceExtension(queen, 12); + addDropTargetExtension(queen, 12); king.setStyleName("card"); - addDragSourceExtension(king); - addDropTargetExtension(king); + addDragSourceExtension(king, 13); + addDropTargetExtension(king, 13); } private void removeExtensions() { @@ -116,11 +117,14 @@ public class DragAndDropCardShuffle extends AbstractTestUIWithLog { king.removeExtension(king.getExtensions().iterator().next()); } - private void addDragSourceExtension(Label source) { + private void addDragSourceExtension(Label source, int cardValue) { // Create and attach extension DragSourceExtension