diff options
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/GridDropTarget.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/GridDropTarget.java | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/server/src/main/java/com/vaadin/ui/GridDropTarget.java b/server/src/main/java/com/vaadin/ui/GridDropTarget.java index 97b9a80ac6..575e5b3f1c 100644 --- a/server/src/main/java/com/vaadin/ui/GridDropTarget.java +++ b/server/src/main/java/com/vaadin/ui/GridDropTarget.java @@ -28,9 +28,9 @@ import com.vaadin.shared.ui.grid.GridDropTargetState; * counterpart of GridDropTargetExtensionConnector. * * @param <T> - * Type of the Grid bean. + * Type of the Grid bean. * @author Vaadin Ltd - * @since + * @since 8.1 */ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { @@ -38,10 +38,10 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { * Extends a Grid and makes it's rows drop targets for HTML5 drag and drop. * * @param target - * Grid to be extended. + * Grid to be extended. * @param dropMode - * Drop mode that describes the allowed drop locations within the - * Grid's row. + * Drop mode that describes the allowed drop locations within the + * Grid's row. * @see GridDropEvent#getDropLocation() */ public GridDropTarget(Grid<T> target, DropMode dropMode) { @@ -54,8 +54,8 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { * Sets the drop mode of this drop target. * * @param dropMode - * Drop mode that describes the allowed drop locations within the - * Grid's row. + * Drop mode that describes the allowed drop locations within the + * Grid's row. * @see GridDropEvent#getDropLocation() */ public void setDropMode(DropMode dropMode) { @@ -77,12 +77,12 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { } /** - * Attaches drop listener for the current drop target. {@link - * GridDropListener#drop(GridDropEvent)} is called when drop event happens - * on the client side. + * Attaches drop listener for the current drop target. + * {@link GridDropListener#drop(GridDropEvent)} is called when drop event + * happens on the client side. * * @param listener - * Listener to handle drop event. + * Listener to handle drop event. * @return Handle to be used to remove this listener. */ public Registration addGridDropListener(GridDropListener<T> listener) { @@ -99,19 +99,20 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { * <li>within {@code threshold} pixels from the top of a row results in a * drop event with {@link com.vaadin.shared.ui.grid.DropLocation#ABOVE * DropLocation.ABOVE}</li> - * <li>within {@code threshold} pixels from the bottom of a row results in - * a drop event with {@link com.vaadin.shared.ui.grid.DropLocation#BELOW + * <li>within {@code threshold} pixels from the bottom of a row results in a + * drop event with {@link com.vaadin.shared.ui.grid.DropLocation#BELOW * DropLocation.BELOW}</li> - * <li>anywhere else within the row results in a drop event with {@link - * com.vaadin.shared.ui.grid.DropLocation#ON_TOP DropLocation.ON_TOP}</li> + * <li>anywhere else within the row results in a drop event with + * {@link com.vaadin.shared.ui.grid.DropLocation#ON_TOP + * DropLocation.ON_TOP}</li> * </ul> - * The value only has an effect when drop mode is set to {@link - * DropMode#ON_TOP_OR_BETWEEN}. + * The value only has an effect when drop mode is set to + * {@link DropMode#ON_TOP_OR_BETWEEN}. * <p> * Default is 5 pixels. * * @param threshold - * The threshold from the top and bottom of the row in pixels. + * The threshold from the top and bottom of the row in pixels. */ public void setDropThreshold(int threshold) { getState().dropThreshold = threshold; @@ -129,18 +130,18 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> { @Override protected void registerDropTargetRpc(Grid<T> target) { - registerRpc( - (GridDropTargetRpc) (dataTransferText, rowKey, dropLocation) -> { + registerRpc((GridDropTargetRpc) (dataTransferText, rowKey, + dropLocation) -> { - T dropTargetRow = target.getDataCommunicator() - .getKeyMapper().get(rowKey); + T dropTargetRow = target.getDataCommunicator().getKeyMapper() + .get(rowKey); - GridDropEvent<T> event = new GridDropEvent<>(target, - dataTransferText, getUI().getActiveDragSource(), - dropTargetRow, dropLocation); + GridDropEvent<T> event = new GridDropEvent<>(target, + dataTransferText, getUI().getActiveDragSource(), + dropTargetRow, dropLocation); - fireEvent(event); - }); + fireEvent(event); + }); } @Override |