aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/event
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-05-02 17:25:36 +0300
committerPekka Hyvönen <pekka@vaadin.com>2017-05-02 17:25:36 +0300
commitd5c7d4b68a2befa3ec874eae8a456614d0333233 (patch)
tree07da146d62e5c8b29abb484d430f24d71a67fa37 /server/src/main/java/com/vaadin/event
parent1f070e124d628ea439a3369e99bbc07bdd917e8d (diff)
downloadvaadin-framework-d5c7d4b68a2befa3ec874eae8a456614d0333233.tar.gz
vaadin-framework-d5c7d4b68a2befa3ec874eae8a456614d0333233.zip
Add method for checking whether drag event was cancelled (#9214)
Diffstat (limited to 'server/src/main/java/com/vaadin/event')
-rw-r--r--server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java b/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java
index 7b304404de..5e0739d2d9 100644
--- a/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java
+++ b/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java
@@ -70,6 +70,17 @@ public class DragEndEvent<T extends AbstractComponent> extends Component.Event {
}
/**
+ * Returns whether the drag event was cancelled. This is a shorthand for
+ * {@code dropEffect == NONE}.
+ *
+ * @return {@code true} if the drop event was cancelled, {@code false}
+ * otherwise.
+ */
+ public boolean isCanceled() {
+ return getDropEffect() == DropEffect.NONE;
+ }
+
+ /**
* Returns the drag source component where the dragend event occurred.
*
* @return Component which was dragged.