From a79339bae7da7d9f0cc867bcf6cef37d0a7afa0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 30 Aug 2012 15:44:18 +0300 Subject: [PATCH] Deprecate addListener in Image (#9285) --- server/src/com/vaadin/ui/Image.java | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java index 8e43d88b37..178e557cf3 100644 --- a/server/src/com/vaadin/ui/Image.java +++ b/server/src/com/vaadin/ui/Image.java @@ -65,29 +65,47 @@ public class Image extends AbstractEmbedded { return (ImageState) super.getState(); } + /** + * @deprecated As of 7.0.0, use {@link #addClickListener(ClickListener)} + * instead + */ + @Deprecated + public void addListener(ClickListener listener) { + addClickListener(listener); + } + /** * Add a click listener to the component. The listener is called whenever * the user clicks inside the component. Depending on the content the event * may be blocked and in that case no event is fired. * - * Use {@link #removeListener(ClickListener)} to remove the listener. + * Use {@link #removeClickListener(ClickListener)} to remove the listener. * * @param listener * The listener to add */ - public void addListener(ClickListener listener) { + public void addClickListener(ClickListener listener) { addListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, listener, ClickListener.clickMethod); } + /** + * @deprecated As of 7.0.0, use {@link #removeClickListener(ClickListener)} + * instead + */ + @Deprecated + public void removeListener(ClickListener listener) { + removeClickListener(listener); + } + /** * Remove a click listener from the component. The listener should earlier - * have been added using {@link #addListener(ClickListener)}. + * have been added using {@link #addClickListener(ClickListener)}. * * @param listener * The listener to remove */ - public void removeListener(ClickListener listener) { + public void removeClickListener(ClickListener listener) { removeListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, listener); } -- 2.39.5