diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-03-22 16:41:35 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-22 16:41:35 +0200 |
commit | acbb5a787b8623745aa440b37705e76dfab21d4e (patch) | |
tree | b85b2e1fae185c54f88123c77db2b8b0c34177a7 /shared/src | |
parent | 52359708adb2033eab2765377d7bcba0b8a97b54 (diff) | |
download | vaadin-framework-acbb5a787b8623745aa440b37705e76dfab21d4e.tar.gz vaadin-framework-acbb5a787b8623745aa440b37705e76dfab21d4e.zip |
Remove support for transfer data type (#8910)
* Remove API for setting arbitrary drag data
* Store the drag source component in the UI
Fixes #8893
Diffstat (limited to 'shared/src')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java | 19 | ||||
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java | 16 |
2 files changed, 11 insertions, 24 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java index 7c3a6363db..766c79e3eb 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java @@ -15,11 +15,6 @@ */ package com.vaadin.shared.ui.dnd; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.vaadin.shared.communication.SharedState; /** @@ -41,18 +36,18 @@ public class DragSourceState extends SharedState { public static final String EVENT_DRAGSTART = "dragstart"; /** - * {@code DataTransfer.effectAllowed} parameter for the drag event. + * Data type {@code "text"} for storing data in {@code DataTransfer} object. */ - public EffectAllowed effectAllowed = EffectAllowed.UNINITIALIZED; + public static final String DATA_TYPE_TEXT = "text"; /** - * {@code DataTransfer.types} parameter. Used to keep track of data formats - * set for the drag event. + * {@code DataTransfer.effectAllowed} parameter for the drag event. */ - public List<String> types = new ArrayList<>(); + public EffectAllowed effectAllowed = EffectAllowed.UNINITIALIZED; /** - * Used to store data in the {@code DataTransfer} object for the drag event. + * Used to store text data in {@code DataTransfer} object for the drag + * event. */ - public Map<String, String> data = new HashMap<>(); + public String dataTransferText; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java index 917bee7d6c..b74fd3a949 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java @@ -15,9 +15,6 @@ */ package com.vaadin.shared.ui.dnd; -import java.util.List; -import java.util.Map; - import com.vaadin.shared.communication.ServerRpc; /** @@ -32,16 +29,11 @@ public interface DropTargetRpc extends ServerRpc { /** * Called when drop event happens on client side. * - * @param types - * Data types that are present in {@code data} map in the same order - * as found in {@code DataTransfer.types}. - * @param data - * Contains data from {@code DataTransfer} object. + * @param dataTransferText + * Data of type {@code "text"} from the {@code DataTransfer} + * object. * @param dropEffect * Drop effect set for the drop target where drop happened. - * @param dragSourceId - * Drag source component connector's ID. */ - public void drop(List<String> types, Map<String, String> data, - DropEffect dropEffect, String dragSourceId); + public void drop(String dataTransferText, DropEffect dropEffect); } |