diff options
author | Petri Heinonen <petri@vaadin.com> | 2012-08-23 13:00:17 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-30 15:32:24 +0300 |
commit | f32d6ab1db5c4732fa3fd13ff8714db6197cc3d4 (patch) | |
tree | f2a6d30671a3bbadf2beafc9f90d2c8fd54bf871 /server/src/com/vaadin/ui/Upload.java | |
parent | 181904db6aa50a10383f098f022da7d4ed801738 (diff) | |
download | vaadin-framework-f32d6ab1db5c4732fa3fd13ff8714db6197cc3d4.tar.gz vaadin-framework-f32d6ab1db5c4732fa3fd13ff8714db6197cc3d4.zip |
refak listeners com.vaadin.ui
Diffstat (limited to 'server/src/com/vaadin/ui/Upload.java')
-rw-r--r-- | server/src/com/vaadin/ui/Upload.java | 110 |
1 files changed, 100 insertions, 10 deletions
diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java index 765a52e542..2323b22e17 100644 --- a/server/src/com/vaadin/ui/Upload.java +++ b/server/src/com/vaadin/ui/Upload.java @@ -570,87 +570,159 @@ public class Upload extends AbstractComponent implements Component.Focusable, * @param listener * the Listener to be added. */ - public void addListener(StartedListener listener) { + public void addStartedListener(StartedListener listener) { addListener(StartedEvent.class, listener, UPLOAD_STARTED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addStartedListener(StartedListener)} + **/ + @Deprecated + public void addListener(StartedListener listener) { + addStartedListener(listener); + } + + /** * Removes the upload started event listener. * * @param listener * the Listener to be removed. */ - public void removeListener(StartedListener listener) { + public void removeStartedListener(StartedListener listener) { removeListener(StartedEvent.class, listener, UPLOAD_STARTED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeStartedListener(StartedListener)} + **/ + @Deprecated + public void removeListener(StartedListener listener) { + removeStartedListener(listener); + } + + /** * Adds the upload received event listener. * * @param listener * the Listener to be added. */ - public void addListener(FinishedListener listener) { + public void addFinishedListener(FinishedListener listener) { addListener(FinishedEvent.class, listener, UPLOAD_FINISHED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addFinishedListener(FinishedListener)} + **/ + @Deprecated + public void addListener(FinishedListener listener) { + addFinishedListener(listener); + } + + /** * Removes the upload received event listener. * * @param listener * the Listener to be removed. */ - public void removeListener(FinishedListener listener) { + public void removeFinishedListener(FinishedListener listener) { removeListener(FinishedEvent.class, listener, UPLOAD_FINISHED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeFinishedListener(FinishedListener)} + **/ + @Deprecated + public void removeListener(FinishedListener listener) { + removeFinishedListener(listener); + } + + /** * Adds the upload interrupted event listener. * * @param listener * the Listener to be added. */ - public void addListener(FailedListener listener) { + public void addFailedListener(FailedListener listener) { addListener(FailedEvent.class, listener, UPLOAD_FAILED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addFailedListener(FailedListener)} + **/ + @Deprecated + public void addListener(FailedListener listener) { + addFailedListener(listener); + } + + /** * Removes the upload interrupted event listener. * * @param listener * the Listener to be removed. */ - public void removeListener(FailedListener listener) { + public void removeFailedListener(FailedListener listener) { removeListener(FailedEvent.class, listener, UPLOAD_FAILED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeFailedListener(FailedListener)} + **/ + @Deprecated + public void removeListener(FailedListener listener) { + removeFailedListener(listener); + } + + /** * Adds the upload success event listener. * * @param listener * the Listener to be added. */ - public void addListener(SucceededListener listener) { + public void addSucceededListener(SucceededListener listener) { addListener(SucceededEvent.class, listener, UPLOAD_SUCCEEDED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addSucceededListener(SucceededListener)} + **/ + @Deprecated + public void addListener(SucceededListener listener) { + addSucceededListener(listener); + } + + /** * Removes the upload success event listener. * * @param listener * the Listener to be removed. */ - public void removeListener(SucceededListener listener) { + public void removeSucceededListener(SucceededListener listener) { removeListener(SucceededEvent.class, listener, UPLOAD_SUCCEEDED_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeSucceededListener(SucceededListener)} + **/ + @Deprecated + public void removeListener(SucceededListener listener) { + removeSucceededListener(listener); + } + + /** * Adds the upload success event listener. * * @param listener * the Listener to be added. */ - public void addListener(ProgressListener listener) { + public void addProgressListener(ProgressListener listener) { if (progressListeners == null) { progressListeners = new LinkedHashSet<ProgressListener>(); } @@ -658,18 +730,36 @@ public class Upload extends AbstractComponent implements Component.Focusable, } /** + * @deprecated Since 7.0, replaced by + * {@link #addProgressListener(ProgressListener)} + **/ + @Deprecated + public void addListener(ProgressListener listener) { + addProgressListener(listener); + } + + /** * Removes the upload success event listener. * * @param listener * the Listener to be removed. */ - public void removeListener(ProgressListener listener) { + public void removeProgressListener(ProgressListener listener) { if (progressListeners != null) { progressListeners.remove(listener); } } /** + * @deprecated Since 7.0, replaced by + * {@link #removeProgressListener(ProgressListener)} + **/ + @Deprecated + public void removeListener(ProgressListener listener) { + removeProgressListener(listener); + } + + /** * Emit upload received event. * * @param filename |