summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-15 13:04:35 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-03-15 13:04:35 +0000
commitc7bc85335cf48276eede6d53961fcfceaec49df7 (patch)
treec1361c405807ac0a03437899ad4167a94e5c9ff9 /src
parentd56d0c3a4d9aec4bb3d63425dc6a242d52278ed7 (diff)
downloadvaadin-framework-c7bc85335cf48276eede6d53961fcfceaec49df7.tar.gz
vaadin-framework-c7bc85335cf48276eede6d53961fcfceaec49df7.zip
removed DragDropPane class, some cleanup
svn changeset:11874/svn branch:6.3
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/event/dd/DropHandler.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java44
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java274
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java11
-rw-r--r--src/com/vaadin/ui/DragAndDropWrapper.java39
-rw-r--r--src/com/vaadin/ui/DragDropPane.java205
-rw-r--r--src/com/vaadin/ui/Upload.java2
7 files changed, 50 insertions, 527 deletions
diff --git a/src/com/vaadin/event/dd/DropHandler.java b/src/com/vaadin/event/dd/DropHandler.java
index cf6d850b7b..555bd7136b 100644
--- a/src/com/vaadin/event/dd/DropHandler.java
+++ b/src/com/vaadin/event/dd/DropHandler.java
@@ -16,7 +16,7 @@ import com.vaadin.event.dd.acceptCriteria.AcceptCriterion;
*/
public interface DropHandler extends Serializable {
- public void drop(DragAndDropEvent dropEvent);
+ public void drop(DragAndDropEvent event);
/**
* Returns the {@link AcceptCriterion} used to evaluate whether the
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
index 606b382c26..990dee9f3c 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
@@ -226,7 +226,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements
}
/**
- *
* Currently supports only FF36 as no other browser supprots natively File
* api.
*
@@ -238,42 +237,17 @@ public class VDragAndDropWrapper extends VCustomComponent implements
public void execute() {
/*
* File contents is sent deferred to allow quick reaction on GUI
- * although file upload may last long. TODO make this use apache
- * file upload instead of our variable post like in upload.
- * Currently stalls the GUI during upload. Also need to use
- * dataurl to support all possible bytes in file content
+ * although file upload may last long.
*/
file.readAsBinary(new Callback() {
public void handleFile(final JavaScriptObject object) {
- DeferredCommand.addCommand(new Command() {
-
- public void execute() {
-
- ExtendedXHR extendedXHR = (ExtendedXHR) ExtendedXHR
- .create();
- extendedXHR.open("POST", client.getAppUri());
- extendedXHR
- .setRequestHeader(
- "PaintableId",
- client
- .getPid(VDragAndDropWrapper.this));
- extendedXHR.setRequestHeader("FileId", ""
- + fileId);
-
- // extendedXHR.setRequestHeader("Connection",
- // "close");
-
- multipartSend(
- extendedXHR,
- object,
- "XHRFILE"
- + client
- .getPid(VDragAndDropWrapper.this)
- + "." + fileId);
-
- }
- });
+ ExtendedXHR extendedXHR = (ExtendedXHR) ExtendedXHR
+ .create();
+ extendedXHR.open("POST", client.getAppUri());
+ String name = "XHRFILE" + getPid() + "." + fileId;
+ multipartSend(extendedXHR, object, name);
+
}
});
@@ -282,6 +256,10 @@ public class VDragAndDropWrapper extends VCustomComponent implements
}
+ private String getPid() {
+ return client.getPid(this);
+ }
+
private native void multipartSend(JavaScriptObject xhr,
JavaScriptObject data, String name)
/*-{
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java b/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java
deleted file mode 100644
index a93d73e8da..0000000000
--- a/src/com/vaadin/terminal/gwt/client/ui/VDragDropPane.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui;
-
-import java.util.Map;
-
-import com.google.gwt.core.client.JsArrayString;
-import com.google.gwt.dom.client.EventTarget;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Container;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
-import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
-import com.vaadin.terminal.gwt.client.ui.dd.VHtml5DragEvent;
-import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
-
-public class VDragDropPane extends VAbsoluteLayout implements Container,
- VHasDropHandler {
-
- private String paintableId;
-
- /**
- * DragEvent is stored here in case of HTML5 drag event.
- */
- private VDragEvent vaadinDragEvent;
-
- public VDragDropPane() {
- super();
- addDomHandler(new MouseDownHandler() {
- public void onMouseDown(MouseDownEvent event) {
- EventTarget eventTarget = event.getNativeEvent()
- .getEventTarget();
- Paintable paintable = client.getPaintable((Element) eventTarget
- .cast());
- if (paintable != null) {
- VTransferable transferable = new VTransferable();
- transferable.setDragSource(VDragDropPane.this);
- transferable.setData("component", paintable);
- VDragEvent drag = VDragAndDropManager.get().startDrag(
- transferable, event.getNativeEvent(), true);
- drag.createDragImage(((Widget) paintable).getElement(),
- true);
- drag.getDropDetails().put(
- "mouseDown",
- new MouseEventDetails(event.getNativeEvent())
- .serialize());
- event.preventDefault(); // prevent text selection
- }
- }
- }, MouseDownEvent.getType());
-
- hookHtml5Events(getElement());
-
- getStyleElement().getStyle().setBackgroundColor("yellow");
-
- }
-
- /**
- * Prototype code, memory leak risk.
- *
- * @param el
- */
- private native void hookHtml5Events(Element el)
- /*-{
-
- var me = this;
-
- if(el.addEventListener) {
- el.addEventListener("dragenter", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragEnter(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- }, false);
-
- el.addEventListener("dragleave", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragLeave(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- }, false);
-
- el.addEventListener("dragover", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragOver(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- }, false);
-
- el.addEventListener("drop", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragDrop(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- }, false);
-
- } else {
- el.attachEvent("ondragenter", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragEnter(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- });
-
- el.attachEvent("ondragleave", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragLeave(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- });
-
- el.attachEvent("ondragover", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragOver(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- });
-
- el.attachEvent("ondrop", function(ev) {
- return me.@com.vaadin.terminal.gwt.client.ui.VDragDropPane::html5DragDrop(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
- });
- }
-
- }-*/;
-
- public boolean html5DragEnter(VHtml5DragEvent event) {
- ApplicationConnection.getConsole().log("HTML 5 Drag Enter");
- VTransferable transferable = new VTransferable();
-
- // TODO refine api somehow so that we will now not use the event preview
- // method provided by manager
- vaadinDragEvent = VDragAndDropManager.get().startDrag(transferable,
- event, false);
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
-
- public boolean html5DragLeave(VHtml5DragEvent event) {
- ApplicationConnection.getConsole().log("HTML 5 Drag Leave posponed...");
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- // Yes, dragleave happens before drop. Makes no sense to me.
- // IMO shouldn't fire leave at all if drop happens (I guess this
- // is what IE does).
- // In Vaadin we fire it only if drop did not happen.
- if (vaadinDragEvent != null) {
- ApplicationConnection.getConsole().log(
- "...HTML 5 Drag Leave");
- getDropHandler().dragLeave(vaadinDragEvent);
- }
- }
- });
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
-
- public boolean html5DragOver(VHtml5DragEvent event) {
- ApplicationConnection.getConsole().log("HTML 5 Drag Over");
- getDropHandler().dragOver(vaadinDragEvent);
- // needed to be set for Safari, otherwise drop will not happen
- String s = event.getEffectAllowed();
- if ("all".equals(s) || s.contains("opy")) {
- event.setDragEffect("copy");
- } else {
- event.setDragEffect(s);
- ApplicationConnection.getConsole().log("Drag effect set to " + s);
- }
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
-
- public boolean html5DragDrop(VHtml5DragEvent event) {
- ApplicationConnection.getConsole().log("HTML 5 Drag Drop");
- VTransferable transferable = vaadinDragEvent.getTransferable();
-
- JsArrayString types = event.getTypes();
- for (int i = 0; i < types.length(); i++) {
- String type = types.get(i);
- ApplicationConnection.getConsole().log("Type: " + type);
- if ("text/plain".equals(type)) {
- String data = event.getDataAsText(type);
- ApplicationConnection.getConsole().log(type + " : " + data);
- transferable.setData("text/plain", data);
- }
- }
-
- String fileAsString = event.getFileAsString(0);
- if (fileAsString != null) {
- ApplicationConnection.getConsole().log(fileAsString);
- transferable.setData("fileContents", fileAsString);
- }
-
- VDragAndDropManager.get().endDrag();
- vaadinDragEvent = null;
- event.preventDefault();
- event.stopPropagation();
-
- return false;
- }
-
- @Override
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- super.updateFromUIDL(uidl, client);
- if (!uidl.hasAttribute("cached")) {
- int childCount = uidl.getChildCount();
- UIDL childUIDL = uidl.getChildUIDL(childCount - 1);
- getDropHandler().updateAcceptRules(childUIDL);
- }
- }
-
- private VAbstractDropHandler dropHandler;
-
- public VAbstractDropHandler getDropHandler() {
- if (dropHandler == null) {
- dropHandler = new VAbstractDropHandler() {
-
- @Override
- public void dragEnter(VDragEvent drag) {
- ApplicationConnection.getConsole().log("DDPane DragEnter");
- super.dragEnter(drag);
- }
-
- @Override
- public Paintable getPaintable() {
- return VDragDropPane.this;
- }
-
- @Override
- public void dragLeave(VDragEvent drag) {
- ApplicationConnection.getConsole().log("DragLeave");
- getStyleElement().getStyle().setBackgroundColor("yellow");
- }
-
- @Override
- public boolean drop(VDragEvent drag) {
- ApplicationConnection.getConsole().log(
- "Drop" + drag.sinceStart());
-
- if (getStyleElement().getStyle().getBackgroundColor()
- .equals("yellow")) {
- // not accepted
- ApplicationConnection.getConsole().log(
- "Drop was not accepted");
- return false;
- }
-
- Map<String, Object> transferable = drag.getDropDetails();
-
- // this is absolute layout based, and we may want to set
- // component
- // relatively to where the drag ended.
- // need to add current location of the drop area
-
- int absoluteLeft = getAbsoluteLeft();
- int absoluteTop = getAbsoluteTop();
-
- transferable.put("absoluteLeft", absoluteLeft);
- transferable.put("absoluteTop", absoluteTop);
-
- getStyleElement().getStyle().setBackgroundColor("yellow");
- return super.drop(drag);
- }
-
- @Override
- protected void dragAccepted(VDragEvent drag) {
- getStyleElement().getStyle().setBackgroundColor("green");
- }
-
- public ApplicationConnection getApplicationConnection() {
- return client;
- }
- };
- }
- return dropHandler;
- }
-
- public Paintable getPaintable() {
- return this;
- }
-
-}
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index ada3869269..f326846c68 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -413,10 +413,15 @@ public abstract class AbstractCommunicationManager implements
.split("\\.");
DragAndDropWrapper ddw = (DragAndDropWrapper) idPaintableMap
.get(split[0]);
-
- ddw.receiveFile(upstream, split[1]);
- String debugId = ddw.getDebugId();
+ try {
+ ddw.receiveFile(upstream, split[1]);
+ } catch (UploadException e) {
+ synchronized (application) {
+ handleChangeVariablesError(application, ddw, e,
+ new HashMap<String, Object>());
+ }
+ }
} else {
diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java
index a848d7af40..65bcbaaa6a 100644
--- a/src/com/vaadin/ui/DragAndDropWrapper.java
+++ b/src/com/vaadin/ui/DragAndDropWrapper.java
@@ -26,6 +26,7 @@ import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.ui.DragAndDropWrapper.WrapperTransferable.Html5File;
import com.vaadin.ui.Upload.Receiver;
+import com.vaadin.ui.Upload.UploadException;
@ClientWidget(VDragAndDropWrapper.class)
public class DragAndDropWrapper extends CustomComponent implements DropTarget,
@@ -75,10 +76,14 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
return files;
}
+ /**
+ * {@link DragAndDropWrapper} can receive also files from client
+ * computer if appropriate HTML 5 features are supported on client side.
+ * This class wraps information about dragged file on server side.
+ */
public class Html5File {
public String name;
- private String id;
private int size;
private Receiver receiver;
private String type;
@@ -96,15 +101,20 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
}
/**
- * 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.
+ * Sets the {@link Receiver} that into which the file contents will
+ * be written. Usage of Reveiver is similar to {@link Upload}
+ * component.
+ *
+ * <p>
+ * <em>Note!</em> receiving file contents is experimental feature
+ * depending on HTML 5 API's. It is supported only by Firefox 3.6 at
+ * this time.
*
* @param receiver
* the callback that returns stream where the
* implementation writes the file contents as it arrives.
*/
- public void receive(Receiver receiver) {
+ public void setReceiver(Receiver receiver) {
this.receiver = receiver;
}
@@ -178,6 +188,12 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
private DragStartMode dragStartMode = DragStartMode.NONE;
+ /**
+ * Wraps given component in a {@link DragAndDropWrapper}.
+ *
+ * @param root
+ * the component to be wrapped
+ */
public DragAndDropWrapper(Component root) {
super(root);
}
@@ -228,12 +244,15 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
* This method should only be used by Vaadin terminal implementation. This
* is not end user api.
*
- * TODO should fire progress events + end/succes events like upload
+ * TODO should fire progress events + end/succes events like upload. Not
+ * critical until we have a wider browser support for HTML5 File API
*
* @param upstream
* @param fileId
+ * @throws UploadException
*/
- public void receiveFile(UploadStream upstream, String fileId) {
+ public void receiveFile(UploadStream upstream, String fileId)
+ throws UploadException {
Html5File file = receivers.get(fileId);
if (file != null && file.receiver != null) {
OutputStream receiveUpload = file.receiver.receiveUpload(file
@@ -247,10 +266,10 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
receiveUpload.write(buf, 0, bytesRead);
}
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ throw new UploadException(e);
}
-
+ // clean up the reference when file is downloaded
+ receivers.remove(fileId);
}
}
diff --git a/src/com/vaadin/ui/DragDropPane.java b/src/com/vaadin/ui/DragDropPane.java
deleted file mode 100644
index b3dc9bd30f..0000000000
--- a/src/com/vaadin/ui/DragDropPane.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-package com.vaadin.ui;
-
-import java.util.Map;
-
-import com.vaadin.event.DataBoundTransferable;
-import com.vaadin.event.Transferable;
-import com.vaadin.event.dd.DragAndDropEvent;
-import com.vaadin.event.dd.DropHandler;
-import com.vaadin.event.dd.DropTarget;
-import com.vaadin.event.dd.DropTargetDetails;
-import com.vaadin.event.dd.DropTargetDetailsImpl;
-import com.vaadin.event.dd.acceptCriteria.AcceptAll;
-import com.vaadin.event.dd.acceptCriteria.AcceptCriterion;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-
-/**
- * Test class that implements various component related Drag and Drop features.
- *
- * TODO consider implementing this kind of general purpose layout class:
- *
- * - extend simple component (CssLayout or CustomComponent, instead of absolute
- * layout)
- *
- * - implement both drag source and drop handler with server side api
- *
- * - implement html5 drop target etc
- *
- * - include a lots of details for drop event (coordinates & sizes of drop
- * position and widget/Paintable hierarchy up to drop handler)
- *
- * This way we could have one rather complex dd component that could be used (by
- * wrapping layouts) in most common situations with server side api. Core
- * layouts wouldn't need changes (and have regression risk/ performance
- * penalty).
- *
- * @deprecated use {@link DragAndDropWrapper} instead
- *
- */
-@Deprecated
-@SuppressWarnings("serial")
-@ClientWidget(com.vaadin.terminal.gwt.client.ui.VDragDropPane.class)
-public class DragDropPane extends AbsoluteLayout implements DropTarget {
-
- private DropHandler dropHandler;
-
- public DragDropPane(DropHandler dropHandler) {
- setWidth("400px");
- setHeight("300px");
-
- if (dropHandler == null) {
- this.dropHandler = new ImportPrettyMuchAnything();
- } else {
- this.dropHandler = dropHandler;
- }
-
- }
-
- public DragDropPane() {
- this(null);
- }
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
- dropHandler.getAcceptCriterion().paint(target);
- }
-
- public DropHandler getDropHandler() {
- return dropHandler;
- }
-
- public static class ImportPrettyMuchAnything implements DropHandler {
- public void drop(DragAndDropEvent event) {
- DragDropPane pane = (DragDropPane) event.getDropTargetDetails()
- .getTarget();
-
- DragEventDetails ed = (DragEventDetails) event
- .getDropTargetDetails();
- Transferable ctr = event.getTransferable();
- if (ctr.getSourceComponent() != null) {
- // use "component" (from DragDropPane) if available, else take
- // the source component
- Component component = (Component) ctr.getData("component");
- if (component == null) {
- component = ctr.getSourceComponent();
- }
-
- if (component.getParent() != pane) {
- if (ctr instanceof DataBoundTransferable) {
- // Item has been dragged, construct a Label from
- // Item id
- Label l = new Label();
- l.setSizeUndefined();
- l.setValue("ItemId : "
- + ((DataBoundTransferable) ctr).getItemId());
- pane.addComponent(l);
- component = l;
-
- } else {
- // we have a component that is been dragged, add
- // it
- // to
- // this
- pane.addComponent(component);
- }
-
- Integer left = ed.getAbsoluteLeft();
- Integer top = ed.getAbsoluteTop();
-
- MouseEventDetails eventDetails = ed.getMouseEvent();
-
- int clientX = eventDetails.getClientX();
- int clientY = eventDetails.getClientY();
-
- try {
- pane.getPosition(component).setTopValue(clientY - top);
- pane.getPosition(component)
- .setLeftValue(clientX - left);
- } catch (Exception e) {
- // TODO: handle exception
- }
- } else {
- // drag ended inside the this Pane
-
- MouseEventDetails start = ed.getMouseDownEvent();
- MouseEventDetails eventDetails = ed.getMouseEvent();
-
- int deltaX = eventDetails.getClientX() - start.getClientX();
- int deltaY = eventDetails.getClientY() - start.getClientY();
-
- ComponentPosition p = pane.getPosition(component);
- p.setTopValue(p.getTopValue() + deltaY);
- p.setLeftValue(p.getLeftValue() + deltaX);
-
- }
-
- } else {
- // drag coming outside of Vaadin
- String object = (String) ctr.getData("text/plain");
-
- String content = (String) ctr.getData("fileContents");
-
- Label l = new Label();
- l.setCaption("Generated from HTML5 drag:");
- if (object != null) {
- l.setValue(object);
- } else {
- l.setValue("HTML5 dd");
- }
-
- l.setDescription(content);
- l.setSizeUndefined();
-
- pane.addComponent(l);
-
- }
- return;
- }
-
- public AcceptCriterion getAcceptCriterion() {
- return AcceptAll.get();
- }
- }
-
- class DragEventDetails extends DropTargetDetailsImpl {
-
- public DragEventDetails(Map<String, Object> rawVariables) {
- super(rawVariables);
- }
-
- public Integer getAbsoluteTop() {
- return (Integer) getData("absoluteTop");
- }
-
- public Integer getAbsoluteLeft() {
- return (Integer) getData("absoluteLeft");
- }
-
- public MouseEventDetails getMouseDownEvent() {
- return MouseEventDetails.deSerialize((String) getData("mouseDown"));
- }
-
- public MouseEventDetails getMouseEvent() {
- return MouseEventDetails
- .deSerialize((String) getData("mouseEvent"));
- }
-
- }
-
- public DropTargetDetails translateDropTargetDetails(
- Map<String, Object> clientVariables) {
- return new DragEventDetails(clientVariables);
- }
-
- public void setDropHandler(DropHandler dropHandler2) {
- dropHandler = dropHandler2;
- requestRepaint();
- }
-
-}
diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java
index 7a3fac9167..fdad5a75cb 100644
--- a/src/com/vaadin/ui/Upload.java
+++ b/src/com/vaadin/ui/Upload.java
@@ -311,7 +311,7 @@ public class Upload extends AbstractComponent implements Component.Focusable {
}
- public class UploadException extends Exception {
+ public static class UploadException extends Exception {
public UploadException(Exception e) {
super("Upload failed", e);
}