diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2016-09-23 13:14:52 +0300 |
---|---|---|
committer | Denis Anisimov <denis@vaadin.com> | 2016-09-29 13:14:35 +0000 |
commit | 2bee988272657df4d886ea79b04be9fbc54d3928 (patch) | |
tree | 6825ec60243faac7fd4114928090e115e2e11d01 /server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java | |
parent | 599b61bc8598db35fa111880dd4db57f9da2adda (diff) | |
download | vaadin-framework-2bee988272657df4d886ea79b04be9fbc54d3928.tar.gz vaadin-framework-2bee988272657df4d886ea79b04be9fbc54d3928.zip |
Unify listeners on the server side
This patch updates server side add*Listener methods to return
a registration object and deprecates their corresponding
remove*Listener methods.
Additionally this patch removes add/removeListener methods which were
deprecated in 7.0.
Change-Id: I26ac5f11882512288fbbf601c7cb2aaff653ec76
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java index 331a0e72be..3be9ca668a 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java @@ -31,6 +31,7 @@ import com.vaadin.server.Sizeable; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; +import com.vaadin.shared.Registration; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutServerRpc; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState; @@ -367,39 +368,22 @@ public abstract class AbstractOrderedLayout extends AbstractLayout } @Override - public void addLayoutClickListener(LayoutClickListener listener) { + public Registration addLayoutClickListener(LayoutClickListener listener) { addListener(EventId.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener, LayoutClickListener.clickMethod); + return () -> removeListener(EventId.LAYOUT_CLICK_EVENT_IDENTIFIER, + LayoutClickEvent.class, listener); } - /** - * @deprecated As of 7.0, replaced by - * {@link #addLayoutClickListener(LayoutClickListener)} - **/ @Override @Deprecated - public void addListener(LayoutClickListener listener) { - addLayoutClickListener(listener); - } - - @Override public void removeLayoutClickListener(LayoutClickListener listener) { removeListener(EventId.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener); } /** - * @deprecated As of 7.0, replaced by - * {@link #removeLayoutClickListener(LayoutClickListener)} - **/ - @Override - @Deprecated - public void removeListener(LayoutClickListener listener) { - removeLayoutClickListener(listener); - } - - /** * Returns the index of the given component. * * @param component |