aboutsummaryrefslogtreecommitdiffstats
path: root/test/servlet-containers/generic-ui
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-26 21:19:41 +0200
committerPekka Maanpää <pekkamaa@vaadin.com>2017-10-26 22:19:41 +0300
commit01c93a6aef27ef562267d7966c6386ecaa6c1f6b (patch)
tree438810691e69e7751710917c251c2ba677c969d4 /test/servlet-containers/generic-ui
parent10bd7544fd22dccd7e8e32cb236eb50f102892d3 (diff)
downloadvaadin-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.java28
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);