summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-03-16 20:35:46 +0200
committerHenri Sara <henri.sara@gmail.com>2017-04-12 14:58:11 +0300
commit1ac4f9724106fcf4abaab892210122231710c6be (patch)
treecd63d9a7d1e689b041ca05d25385d4b39929782d /shared
parent2df1b373aae547275b566fef957322af0b61b427 (diff)
downloadvaadin-framework-1ac4f9724106fcf4abaab892210122231710c6be.tar.gz
vaadin-framework-1ac4f9724106fcf4abaab892210122231710c6be.zip
Make it possible to drop things on top of Grid rows (#8747)
Fixes #8400
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java5
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java39
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java28
3 files changed, 67 insertions, 5 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java
index 39a5917146..682863ab88 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionState.java
@@ -26,11 +26,6 @@ import com.vaadin.shared.ui.dnd.DragSourceState;
public class GridDragSourceExtensionState extends DragSourceState {
/**
- * Data type for storing the dragged row's data.
- */
- public static final String DATA_TYPE_DRAG_DATA = "grid-drag-data";
-
- /**
* Json key for storing data for a dragged row.
*/
public static final String JSONKEY_DRAG_DATA = "drag-data";
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java
new file mode 100644
index 0000000000..ef0dc405b5
--- /dev/null
+++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionRpc.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.grid;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * RPC for firing server side drop event when client side drop event happens on
+ * drop target Grid.
+ *
+ * @author Vaadin Ltd.
+ * @since
+ */
+public interface GridDropTargetExtensionRpc extends ServerRpc {
+
+ /**
+ * Called when drop event happens on client side.
+ *
+ * @param dataTransferText
+ * Data of type {@code "text"} from the {@code DataTransfer}
+ * object.
+ * @param rowKey
+ * Key of the row on which the drop event occured.
+ */
+ public void drop(String dataTransferText, String rowKey);
+}
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java
new file mode 100644
index 0000000000..c911d529d0
--- /dev/null
+++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetExtensionState.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.grid;
+
+import com.vaadin.shared.ui.dnd.DropTargetState;
+
+/**
+ * State class containing parameters for GridDropTargetExtension.
+ *
+ * @author Vaadin Ltd
+ * @since
+ */
+public class GridDropTargetExtensionState extends DropTargetState {
+
+}