Class GridDropEvent<T>

    • Constructor Detail

      • GridDropEvent

        public GridDropEvent​(Grid<T> target,
                             java.util.Map<java.lang.String,​java.lang.String> data,
                             com.vaadin.shared.ui.dnd.DropEffect dropEffect,
                             DragSourceExtension<? extends AbstractComponent> dragSourceExtension,
                             T dropTargetRow,
                             com.vaadin.shared.ui.grid.DropLocation dropLocation,
                             com.vaadin.shared.MouseEventDetails mouseEventDetails)
        Creates a Grid row drop event.
        Parameters:
        target - Grid that received the drop.
        data - Map containing all types and corresponding data from the DataTransfer object.
        dropEffect - the desired drop effect
        dragSourceExtension - Drag source extension of the component that initiated the drop event.
        dropTargetRow - Target row that received the drop, or null if dropped on empty grid or DropMode.ON_GRID is used
        dropLocation - Location of the drop within the target row.
        mouseEventDetails - mouse event details object containing information about the drop event
    • Method Detail

      • getDropTargetRow

        public java.util.Optional<T> getDropTargetRow()
        Get the row the drop happened on.

        If the drop was not on top of a row (see getDropLocation()) or DropMode.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 com.vaadin.shared.ui.grid.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() or DropLocation.EMPTY if no target row present
        See Also:
        GridDropTarget.setDropMode(DropMode)