01: /*
02: * $Id: ClockPage.java 460265 2006-04-16 13:36:52Z jdonnerstag $ $Revision: 460265 $
03: * $Date: 2006-04-16 15:36:52 +0200 (Sun, 16 Apr 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.examples.ajax.builtin;
19:
20: import java.util.TimeZone;
21:
22: import wicket.ajax.AjaxSelfUpdatingTimerBehavior;
23: import wicket.util.time.Duration;
24:
25: /**
26: * A simple clock example page
27: *
28: * @author Igor Vaynberg (ivaynberg)
29: */
30: public class ClockPage extends BasePage {
31: /**
32: * Constructor
33: */
34: public ClockPage() {
35: // add the clock component
36: Clock clock = new Clock("clock", TimeZone
37: .getTimeZone("America/Los_Angeles"));
38: add(clock);
39:
40: // add the ajax behavior which will keep updating the component every 5
41: // seconds
42: clock
43: .add(new AjaxSelfUpdatingTimerBehavior(Duration
44: .seconds(5)));
45: }
46: }
|