diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-11 15:56:16 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-11 15:56:16 +0000 |
commit | 7da4b810a4445b3bd14d26aa89ae0547d056b5e8 (patch) | |
tree | aa78326fbff822123bb6469ca2e76765d7d2f626 /src/com/vaadin/ui | |
parent | 77a45238fababd776e2a0ac828838aff160a3d73 (diff) | |
download | vaadin-framework-7da4b810a4445b3bd14d26aa89ae0547d056b5e8.tar.gz vaadin-framework-7da4b810a4445b3bd14d26aa89ae0547d056b5e8.zip |
Skeletons for html5 File API in DD
svn changeset:11800/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r-- | src/com/vaadin/ui/DragAndDropWrapper.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java index 848e728bae..3274b60b47 100644 --- a/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/src/com/vaadin/ui/DragAndDropWrapper.java @@ -4,6 +4,7 @@ package com.vaadin.ui; import java.util.Map; +import java.util.Set; import com.vaadin.event.Transferable; import com.vaadin.event.TransferableImpl; @@ -18,6 +19,7 @@ import com.vaadin.terminal.gwt.client.MouseEventDetails; import com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper; import com.vaadin.terminal.gwt.client.ui.dd.HorizontalDropLocation; import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation; +import com.vaadin.ui.Upload.Receiver; @ClientWidget(VDragAndDropWrapper.class) public class DragAndDropWrapper extends CustomComponent implements DropTarget, @@ -48,6 +50,39 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, return MouseEventDetails.deSerialize((String) getData("mouseDown")); } + public Html5File[] getFiles() { + // TODO Auto-generated method stub + return null; + } + + public class Html5File { + + public String getFileName() { + // TODO Auto-generated method stub + return null; + } + + // public int getFileSize() { + // // TODO Auto-generated method stub + // return 0; + // } + + /** + * HTML5 drags are read from client disk with a callback. This and + * possibly long transfer time forces us to receive dragged file + * contents with a callback. + * + * @param receiver + * the callback that returns stream where the + * implementation writes the file contents as it arrives. + */ + public void receive(Receiver receiver) { + // TODO Auto-generated method stub + + } + + } + } public class WrapperDropDetails extends DropTargetDetailsImpl { @@ -159,4 +194,14 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, public DragStartMode getDragStartMode() { return dragStartMode; } + + @Override + public void changeVariables(Object source, Map<String, Object> variables) { + super.changeVariables(source, variables); + + Set<String> keySet = variables.keySet(); + for (String string : keySet) { + // TODO get files + } + } } |