From d5c7d4b68a2befa3ec874eae8a456614d0333233 Mon Sep 17 00:00:00 2001 From: Adam Wagner Date: Tue, 2 May 2017 17:25:36 +0300 Subject: Add method for checking whether drag event was cancelled (#9214) --- server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/src/main/java/com/vaadin/event') 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 @@ -69,6 +69,17 @@ public class DragEndEvent extends Component.Event { return dropEffect; } + /** + * 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. * -- cgit v1.2.3