diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-26 21:19:41 +0200 |
---|---|---|
committer | Pekka Maanpää <pekkamaa@vaadin.com> | 2017-10-26 22:19:41 +0300 |
commit | 01c93a6aef27ef562267d7966c6386ecaa6c1f6b (patch) | |
tree | 438810691e69e7751710917c251c2ba677c969d4 /test/servlet-containers/generic-ui | |
parent | 10bd7544fd22dccd7e8e32cb236eb50f102892d3 (diff) | |
download | vaadin-framework-01c93a6aef27ef562267d7966c6386ecaa6c1f6b.tar.gz vaadin-framework-01c93a6aef27ef562267d7966c6386ecaa6c1f6b.zip |
Use lambda with Listeners (#10222)
Also use "event" as the name for events
Diffstat (limited to 'test/servlet-containers/generic-ui')
-rw-r--r-- | test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java index a3f2dd1c47..058028a2e7 100644 --- a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java @@ -15,17 +15,16 @@ */ package com.vaadin.tests.integration.push; +import java.util.Timer; +import java.util.TimerTask; + import com.vaadin.annotations.Push; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.ContentMode; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import java.util.Timer; -import java.util.TimerTask; - @Push public class BasicPush extends AbstractTestUI { @@ -59,13 +58,9 @@ public class BasicPush extends AbstractTestUI { addComponent(lbl); Button incrementButton = new Button("Increment", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - clientCounter++; - lbl.setValue(String.valueOf(clientCounter)); - } + event -> { + clientCounter++; + lbl.setValue(String.valueOf(clientCounter)); }); incrementButton.setId(INCREMENT_BUTTON_ID); addComponent(incrementButton); @@ -103,13 +98,10 @@ public class BasicPush extends AbstractTestUI { startTimer.setId(START_TIMER_ID); addComponent(startTimer); - Button stopTimer = new Button("Stop timer", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - if (task != null) { - task.cancel(); - task = null; - } + Button stopTimer = new Button("Stop timer", event -> { + if (task != null) { + task.cancel(); + task = null; } }); stopTimer.setId(STOP_TIMER_ID); |