diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-04-27 13:00:58 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-04-27 14:00:58 +0300 |
commit | 7dbc5414239ae6c84d4e48be7321798e79709db5 (patch) | |
tree | 25abfb62421679b39fd2015dfd119ec51363fa74 /server | |
parent | ac73dd5197d2d7e58f1f069e2c28c658498c8cbe (diff) | |
download | vaadin-framework-7dbc5414239ae6c84d4e48be7321798e79709db5.tar.gz vaadin-framework-7dbc5414239ae6c84d4e48be7321798e79709db5.zip |
Make some of dnd's javadoc clearer.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java | 16 | ||||
-rw-r--r-- | server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java | 9 |
2 files changed, 21 insertions, 4 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 bb9b97a900..7b304404de 100644 --- a/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java +++ b/server/src/main/java/com/vaadin/event/dnd/DragEndEvent.java @@ -16,6 +16,7 @@ package com.vaadin.event.dnd; import com.vaadin.shared.ui.dnd.DropEffect; +import com.vaadin.shared.ui.dnd.EffectAllowed; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Component; @@ -46,10 +47,23 @@ public class DragEndEvent<T extends AbstractComponent> extends Component.Event { } /** - * Get drop effect of the dragend event. + * Get drop effect of the dragend event. The value will be the desired + * action, that is the dropEffect value of the last dragenter or dragover + * event. The value depends on the effectAllowed parameter of the drag + * source, the dropEffect parameter of the drop target, and its drag over + * and drop criteria. + * <p> + * If the drop is not successful, the value will be {@code NONE}. + * <p> + * In case the desired drop effect is {@code MOVE}, the data being dragged + * should be removed from the source. * * @return The {@code DataTransfer.dropEffect} parameter of the client side * dragend event. + * @see DragSourceExtension#setEffectAllowed(EffectAllowed) + * @see DropTargetExtension#setDropEffect(DropEffect) + * @see DropTargetExtension#setDragOverCriteria(String) + * @see DropTargetExtension#setDropCriteria(String) */ public DropEffect getDropEffect() { return dropEffect; diff --git a/server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java b/server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java index fcca5efadb..a1b08980b2 100644 --- a/server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java +++ b/server/src/main/java/com/vaadin/event/dnd/DropTargetExtension.java @@ -124,10 +124,11 @@ public class DropTargetExtension<T extends AbstractComponent> extends } /** - * Returns the criteria for allowing dragover event on the current drop - * target. + * Gets the criteria script that executes when dragover event happens. If + * the script returns {@code false}, the dragover event will be stopped. * * @return JavaScript that executes when dragover event happens. + * @see #setDragOverCriteria(String) */ public String getDragOverCriteria() { return getState(false).dragOverCriteria; @@ -165,9 +166,11 @@ public class DropTargetExtension<T extends AbstractComponent> extends } /** - * Returns the criteria for allowing drop event on the current drop target. + * Gets the criteria script that executes when drop event happens. If the + * script returns {@code false}, the drop event will be stopped. * * @return JavaScript that executes when drop event happens. + * @see #setDropCriteria(String) */ public String getDropCriteria() { return getState(false).dropCriteria; |