Package 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:
Serializable
- Direct Known Subclasses:
TreeGridDropEvent
public class GridDropEvent<T> extends DropEvent<Grid<T>>
Drop event on an HTML5 drop targetGridrow.- 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 Instance Methods Concrete Methods Modifier and Type Method Description DropLocationgetDropLocation()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 theDataTransferobject.dropEffect- the desired drop effectdragSourceExtension- Drag source extension of the component that initiated the drop event.dropTargetRow- Target row that received the drop, ornullif dropped on empty grid orDropMode.ON_GRIDis 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_GRIDis 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.EMPTYif:- dropped on an empty grid
- dropping on rows was not possible because of
DropMode.ON_GRIDwas used DropMode.ON_TOPis 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.EMPTYif no target row present - See Also:
GridDropTarget.setDropMode(DropMode)
-
-