diff options
author | Leif Åstrand <leif@vaadin.com> | 2016-11-23 09:52:07 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2016-11-23 09:52:07 +0200 |
commit | 68ea8ea63d9ba04f166f0a5897516c586c696e50 (patch) | |
tree | 31c99d3ee27d810e80e6365c32c47a0525b38918 /server/src/main/java/com/vaadin/ui/Panel.java | |
parent | b9a107c2f7a8227c12a6df6a29c9abaf292863c9 (diff) | |
download | vaadin-framework-68ea8ea63d9ba04f166f0a5897516c586c696e50.tar.gz vaadin-framework-68ea8ea63d9ba04f166f0a5897516c586c696e50.zip |
Refactor listener registration creation to reduce boilerplate
Change-Id: I9feaad000cb16351d281d1c0037330dfb76186ff
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/Panel.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Panel.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Panel.java b/server/src/main/java/com/vaadin/ui/Panel.java index c179df9be2..55ca2c643e 100644 --- a/server/src/main/java/com/vaadin/ui/Panel.java +++ b/server/src/main/java/com/vaadin/ui/Panel.java @@ -273,10 +273,8 @@ public class Panel extends AbstractSingleComponentContainer * @return a registration object for removing the listener */ public Registration addClickListener(ClickListener listener) { - addListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, listener, - ClickListener.clickMethod); - return () -> removeListener(EventId.CLICK_EVENT_IDENTIFIER, - ClickEvent.class, listener); + return addListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class, + listener, ClickListener.clickMethod); } /** |