com.vaadin.ui.dnd.event.
Class DragEndEvent<T extends AbstractComponent>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.event.ConnectorEvent
-
- com.vaadin.ui.Component.Event
-
- com.vaadin.ui.dnd.event.DragEndEvent<T>
-
Type Parameters:
T
- Type of the component that was dragged.All Implemented Interfaces:
Direct Known Subclasses:
public class DragEndEvent<T extends AbstractComponent> extends Component.Event
HTML5 drag end event.
Since:
8.1
Author:
Vaadin Ltd
See Also:
DragSourceExtension.addDragEndListener(DragEndListener)
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description DragEndEvent​(T source, DropEffect dropEffect)
Creates a drag end event.
-
Method Summary
All Methods Modifier and Type Method Description T
getComponent()
Returns the drag source component where the dragend event occurred.
DropEffect
getDropEffect()
Get drop effect of the dragend event.
boolean
isCanceled()
Returns whether the drag event was cancelled.
-
Methods inherited from class com.vaadin.event.ConnectorEvent
getConnector
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
DragEndEvent
public DragEndEvent​(T source, DropEffect dropEffect)
Creates a drag end event.
Parameters:
source
- Component that was dragged.dropEffect
- Drop effect fromDataTransfer.dropEffect
object.
-
-
Method Detail
-
getDropEffect
public DropEffect getDropEffect()
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.
If the drop is not successful, the value will be
NONE
.In case the desired drop effect is
MOVE
, the data being dragged should be removed from the source.Returns:
The
DataTransfer.dropEffect
parameter of the client side dragend event.See Also:
DragSourceExtension#setEffectAllowed(EffectAllowed)
,DropTargetExtension.setDropEffect(DropEffect)
,DropTargetExtension.setDropCriteriaScript(String)
-
isCanceled
public boolean isCanceled()
Returns whether the drag event was cancelled. This is a shorthand for
dropEffect == NONE
.Returns:
true
if the drop event was cancelled,false
otherwise.
-
getComponent
public T getComponent()
Returns the drag source component where the dragend event occurred.
Overrides:
getComponent
in classComponent.Event
Returns:
Component which was dragged.
-
-