aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/CssLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/CssLayout.java')
-rw-r--r--server/src/main/java/com/vaadin/ui/CssLayout.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/server/src/main/java/com/vaadin/ui/CssLayout.java b/server/src/main/java/com/vaadin/ui/CssLayout.java
index 381e7aa463..d4daf67419 100644
--- a/server/src/main/java/com/vaadin/ui/CssLayout.java
+++ b/server/src/main/java/com/vaadin/ui/CssLayout.java
@@ -17,6 +17,7 @@ package com.vaadin.ui;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.Objects;
import org.jsoup.nodes.Element;
@@ -26,6 +27,7 @@ import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
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.csslayout.CssLayoutServerRpc;
import com.vaadin.shared.ui.csslayout.CssLayoutState;
import com.vaadin.ui.declarative.DesignContext;
@@ -303,39 +305,22 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier {
}
@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
@@ -397,5 +382,4 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier {
designElement.appendChild(childNode);
}
}
-
}