com.vaadin.ui.components.grid.
Class GridDropEvent<T>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.event.ConnectorEvent
-
- com.vaadin.ui.Component.Event
-
- com.vaadin.ui.dnd.event.DropEvent<Grid<T>>
-
- com.vaadin.ui.components.grid.GridDropEvent<T>
-
Type Parameters:
T
- The Grid bean type.All Implemented Interfaces:
Direct Known Subclasses:
public class GridDropEvent<T> extends DropEvent<Grid<T>>
Drop event on an HTML5 drop target
Grid
row.Since:
8.1
Author:
Vaadin Ltd.
See Also:
GridDropTarget.addGridDropListener(GridDropListener)
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description GridDropEvent(Grid<T> target, Map<String,String> data, DropEffect dropEffect, DragSourceExtension<? extends AbstractComponent> dragSourceExtension, T dropTargetRow, DropLocation dropLocation, MouseEventDetails mouseEventDetails)
Creates a Grid row drop event.
-
Method Summary
All Methods Modifier and Type Method Description DropLocation
getDropLocation()
Get the location of the drop within the row.
Optional<T>
getDropTargetRow()
Get the row the drop happened on.
-
Methods inherited from class com.vaadin.ui.dnd.event.DropEvent
getComponent, getDataTransferData, getDataTransferData, getDataTransferText, getDragData, getDragSourceComponent, getDragSourceExtension, getDropEffect, getMouseEventDetails
-
Methods inherited from class com.vaadin.event.ConnectorEvent
getConnector
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
GridDropEvent
public GridDropEvent(Grid<T> target, Map<String,String> data, DropEffect dropEffect, DragSourceExtension<? extends AbstractComponent> dragSourceExtension, T dropTargetRow, DropLocation dropLocation, MouseEventDetails mouseEventDetails)
Creates a Grid row drop event.
Parameters:
target
- Grid that received the drop.data
- Map containing all types and corresponding data from theDataTransfer
object.dropEffect
- the desired drop effectdragSourceExtension
- Drag source extension of the component that initiated the drop event.dropTargetRow
- Target row that received the drop, ornull
if dropped on empty grid orDropMode.ON_GRID
is useddropLocation
- Location of the drop within the target row.mouseEventDetails
- mouse event details object containing information about the drop event
-
-
Method Detail
-
getDropTargetRow
public Optional<T> getDropTargetRow()
Get the row the drop happened on.
If the drop was not on top of a row (see
getDropLocation()
) orDropMode.ON_GRID
is used, then returns an empty optional.Returns:
The row the drop happened on, or an empty optional if drop was not on a row
-
getDropLocation
public DropLocation getDropLocation()
Get the location of the drop within the row.
NOTE: the location will be
DropLocation.EMPTY
if:- dropped on an empty grid
- dropping on rows was not possible because of
DropMode.ON_GRID
was used DropMode.ON_TOP
is used and the drop happened on empty space after last row or on top of the header / footer
Returns:
location of the drop in relative to the
getDropTargetRow()
orDropLocation.EMPTY
if no target row presentSee Also:
-
-