summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-22 15:50:55 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-22 15:50:55 +0000
commit67a01f5080518da18b0d8f04fdaa889bbddbe7a4 (patch)
tree3b56a597adf5a8073108049abd433d0a75827b56
parentc1566151950edf24e0bf62807f38d0b070c9963d (diff)
downloadvaadin-framework-67a01f5080518da18b0d8f04fdaa889bbddbe7a4.tar.gz
vaadin-framework-67a01f5080518da18b0d8f04fdaa889bbddbe7a4.zip
Suggestive api for basic html5 data types.
svn changeset:12017/svn branch:6.3
-rw-r--r--src/com/vaadin/ui/DragAndDropWrapper.java18
-rw-r--r--tests/src/com/vaadin/tests/dd/DragDropPane.java7
2 files changed, 20 insertions, 5 deletions
diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java
index a9089443ec..c9e8954529 100644
--- a/src/com/vaadin/ui/DragAndDropWrapper.java
+++ b/src/com/vaadin/ui/DragAndDropWrapper.java
@@ -76,6 +76,24 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
return files;
}
+ public String getText() {
+ String data = (String) getData("Text"); // IE, html5
+ if (data == null) {
+ // check for "text/plain" (webkit)
+ data = (String) getData("text/plain");
+ }
+ return data;
+ }
+
+ public String getHtml() {
+ String data = (String) getData("Html"); // IE, html5
+ if (data == null) {
+ // check for "text/plain" (webkit)
+ data = (String) getData("text/html");
+ }
+ return data;
+ }
+
/**
* {@link DragAndDropWrapper} can receive also files from client
* computer if appropriate HTML 5 features are supported on client side.
diff --git a/tests/src/com/vaadin/tests/dd/DragDropPane.java b/tests/src/com/vaadin/tests/dd/DragDropPane.java
index cd7a372d2e..2b75760e50 100644
--- a/tests/src/com/vaadin/tests/dd/DragDropPane.java
+++ b/tests/src/com/vaadin/tests/dd/DragDropPane.java
@@ -113,11 +113,8 @@ public class DragDropPane extends DragAndDropWrapper implements DropHandler {
WrapperTransferable wtr = (WrapperTransferable) ctr;
- String object = (String) ctr.getData("Text");
- if (object == null) {
- object = (String) ctr.getData("text/plain");
- }
- String html = (String) ctr.getData("Html");
+ String object = wtr.getText();
+ String html = wtr.getHtml();
String url = (String) ctr.getData("Url");
final Label l = new Label();