From 2d88e0f7492bb6b5de0e997df03fc7fda9b858c9 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 12 Oct 2010 15:20:48 +0000 Subject: [PATCH] removed done todo + added API that don't use deprecated Receiver, fine tuning #5741 svn changeset:15523/svn branch:6.5 --- src/com/vaadin/ui/Upload.java | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java index 1acc91031e..3fcafe7260 100644 --- a/src/com/vaadin/ui/Upload.java +++ b/src/com/vaadin/ui/Upload.java @@ -76,7 +76,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, /** * The output of the upload is redirected to this receiver. */ - private Receiver receiver; + private com.vaadin.terminal.Receiver receiver; private boolean isUploading; @@ -99,8 +99,6 @@ public class Upload extends AbstractComponent implements Component.Focusable, private int nextid; - /* TODO: Add a default constructor, receive to temp file. */ - /** * Creates a new instance of Upload. * @@ -109,6 +107,17 @@ public class Upload extends AbstractComponent implements Component.Focusable, public Upload() { } + /** + * @deprecated use + * {@link Upload#Upload(String, com.vaadin.terminal.Receiver)} + * instead + */ + @Deprecated + public Upload(String caption, Receiver uploadReceiver) { + setCaption(caption); + receiver = uploadReceiver; + } + /** * Creates a new instance of Upload that redirects the uploaded data to * stream given by the Receiver. @@ -119,7 +128,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, * @param uploadReceiver * Receiver to call to retrieve output stream when upload starts. */ - public Upload(String caption, Receiver uploadReceiver) { + public Upload(String caption, com.vaadin.terminal.Receiver uploadReceiver) { setCaption(caption); receiver = uploadReceiver; } @@ -751,20 +760,33 @@ public class Upload extends AbstractComponent implements Component.Focusable, * * @return the Receiver. */ - public Receiver getReceiver() { + public com.vaadin.terminal.Receiver getReceiver() { return receiver; } /** * Sets the receiver. * + * @deprecated use {@link #setReceiver(com.vaadin.terminal.Receiver)} + * instead * @param receiver * the receiver to set. */ + @Deprecated public void setReceiver(Receiver receiver) { this.receiver = receiver; } + /** + * Sets the receiver. + * + * @param receiver + * the receiver to set. + */ + public void setReceiver(com.vaadin.terminal.Receiver receiver) { + this.receiver = receiver; + } + /** * {@inheritDoc} */ -- 2.39.5