aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-04-13 11:47:45 +0300
committerHenri Sara <henri.sara@gmail.com>2017-04-13 11:47:45 +0300
commitdd1d288d5fe7b3a1ee3db93afccacae72bc7408c (patch)
tree27231f5752e0840e6838a2e1885249bac9b6dd56 /shared
parent8cf7b41e3f3dddb0a83cbc422511adb24796f85d (diff)
downloadvaadin-framework-dd1d288d5fe7b3a1ee3db93afccacae72bc7408c.tar.gz
vaadin-framework-dd1d288d5fe7b3a1ee3db93afccacae72bc7408c.zip
Create combined drop mode to allow both on_top and between drops (#9063)
Resolves #8932
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/grid/DropMode.java14
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java8
2 files changed, 22 insertions, 0 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/DropMode.java b/shared/src/main/java/com/vaadin/shared/ui/grid/DropMode.java
index 2db639be7d..1da17f1bba 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/grid/DropMode.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/grid/DropMode.java
@@ -35,4 +35,18 @@ public enum DropMode {
* is the row under the cursor at the time of the drop event.
*/
ON_TOP,
+
+ /**
+ * The drop event can happen either on top of or between Grid rows. The drop
+ * is either
+ * <ul>
+ * <li><i>above</i> a row when the cursor is over a specified portion of
+ * the top part of the row,</li>
+ * <li><i>below</i> when the cursor is over a specified portion of the
+ * bottom part of the row, or</li>
+ * <li><i>on top</i> when the cursor is over the row but doesn't match the
+ * above conditions.</li>
+ * </ul>
+ */
+ ON_TOP_OR_BETWEEN
}
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java
index aae051b299..36869bfd62 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetState.java
@@ -29,4 +29,12 @@ public class GridDropTargetState extends DropTargetState {
* Stores the drop mode of the drop target Grid.
*/
public DropMode dropMode;
+
+ /**
+ * Stores the threshold between drop locations within a row in pixels.
+ * Defaults to 5px.
+ *
+ * @see DropMode#ON_TOP_OR_BETWEEN
+ */
+ public int dropThreshold = 5;
}