01: /*
02: * $Id: MarkupInheritanceBase_12.java 459597 2006-03-03 15:39:20Z jdonnerstag $
03: * $Revision: 459597 $
04: * $Date: 2006-03-03 16:39:20 +0100 (Fri, 03 Mar 2006) $
05: *
06: * ====================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License");
08: * you may not use this file except in compliance with the License.
09: * You may obtain a copy of the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS,
15: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: * See the License for the specific language governing permissions and
17: * limitations under the License.
18: */
19: package wicket.markup;
20:
21: import wicket.markup.html.WebPage;
22: import wicket.markup.html.basic.Label;
23: import wicket.markup.html.link.Link;
24: import wicket.model.PropertyModel;
25:
26: /**
27: */
28: public class MarkupInheritanceBase_12 extends WebPage {
29: private static final long serialVersionUID = 1L;
30:
31: private int counter = 0;
32:
33: /**
34: * Construct.
35: *
36: */
37: public MarkupInheritanceBase_12() {
38: add(new Label("label1", new PropertyModel(this , "counter")));
39: add(new Link("link") {
40: private static final long serialVersionUID = 1L;
41:
42: public void onClick() {
43: counter++;
44: }
45: });
46: }
47:
48: /**
49: * Gets the counter.
50: * @return counter
51: */
52: public int getCounter() {
53: return counter;
54: }
55:
56: /**
57: * Sets the counter.
58: * @param counter counter
59: */
60: public void setCounter(int counter) {
61: this.counter = counter;
62: }
63: }
|