You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2016/04/05 15:19:37 UTC
wicket git commit: testing lambda APIs
Repository: wicket
Updated Branches:
refs/heads/master 04bdb4671 -> 7598c398f
testing lambda APIs
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7598c398
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7598c398
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7598c398
Branch: refs/heads/master
Commit: 7598c398f3f507c1cff773952efddcb48bd070e9
Parents: 04bdb46
Author: Sven Meier <sv...@apache.org>
Authored: Tue Apr 5 15:19:22 2016 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Tue Apr 5 15:19:22 2016 +0200
----------------------------------------------------------------------
.../examples/ajax/builtin/WorldClockPage.java | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/7598c398/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/WorldClockPage.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/WorldClockPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/WorldClockPage.java
index 58af898..cffe168 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/WorldClockPage.java
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/WorldClockPage.java
@@ -16,6 +16,8 @@
*/
package org.apache.wicket.examples.ajax.builtin;
+import static org.apache.wicket.ajax.AbstractAjaxTimerBehavior.onTimer;
+
import java.util.TimeZone;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
@@ -60,21 +62,7 @@ public class WorldClockPage extends BasePage
// add the timer behavior to the page and make it update all
// other components as well
- final AbstractAjaxTimerBehavior timer = new AbstractAjaxTimerBehavior(Duration.seconds(1))
- {
- /**
- * @see org.apache.wicket.ajax.AbstractAjaxTimerBehavior#onTimer(org.apache.wicket.ajax.AjaxRequestTarget)
- */
- @Override
- protected void onTimer(AjaxRequestTarget target)
- {
- target.add(la);
- target.add(ny);
- target.add(moscow);
- target.add(prague);
- target.add(london);
- }
- };
+ final AbstractAjaxTimerBehavior timer = onTimer(Duration.seconds(1), target-> target.add(la, ny, moscow, prague, london));
add(timer);
add(new AjaxLink<Void>("stop")