From 659313e8c35e68d14fe2599b9bbb4dbba35fb4a3 Mon Sep 17 00:00:00 2001 From: Adam Wagner Date: Thu, 30 Mar 2017 13:18:10 +0300 Subject: Provide dragged Grid items in server side (#8950) Fixes #8931 --- .../com/vaadin/shared/ui/dnd/DragSourceRpc.java | 2 +- .../shared/ui/grid/GridDragSourceExtensionRpc.java | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java (limited to 'shared/src') diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java index 4faf7ca139..1f016d5908 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceRpc.java @@ -27,7 +27,7 @@ import com.vaadin.shared.communication.ServerRpc; public interface DragSourceRpc extends ServerRpc { /** - * Called when dragsource event happens on client side. + * Called when dragstart event happens on client side. */ public void dragStart(); diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java new file mode 100644 index 0000000000..c0e24fe847 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDragSourceExtensionRpc.java @@ -0,0 +1,50 @@ +/* + * 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 java.util.List; + +import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.shared.ui.dnd.DropEffect; + +/** + * RPC for firing server side drag start and drag end events when the + * corresponding client side events happen on the drag source Grid. + * + * @author Vaadin Ltd. + * @since + */ +public interface GridDragSourceExtensionRpc extends ServerRpc { + + /** + * Called when dragstart event happens on client side. + * + * @param draggedItemKeys + * Keys of the items in Grid being dragged. + */ + public void dragStart(List draggedItemKeys); + + /** + * Called when dragend event happens on client side. + * + * @param dropEffect + * Drop effect of the dragend event, extracted from {@code + * DataTransfer.dropEffect} parameter. + * @param draggedItemKeys + * Keys of the items in Grid having been dragged. + */ + public void dragEnd(DropEffect dropEffect, List draggedItemKeys); +} -- cgit v1.2.3