01: /*
02: * $Id: ContainerWithAssociatedMarkupHelper.java,v 1.1 2006/03/10 22:20:42
03: * jdonnerstag Exp $ $Revision: 460441 $ $Date: 2006/03/10 22:20:42 $
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.markup.html.header.testing3;
19:
20: import wicket.Page;
21: import wicket.markup.html.WebPage;
22: import wicket.markup.html.link.IPageLink;
23: import wicket.markup.html.link.PageLink;
24: import wicket.markup.html.panel.Panel;
25:
26: /**
27: *
28: * @author Juergen Donnerstag
29: */
30: public class TestPage extends WebPage {
31: private static final long serialVersionUID = 1L;
32:
33: private final Panel panel1 = new Panel1("panel");
34: private final Panel panel2 = new Panel2("panel");
35: private Panel current;
36:
37: /**
38: * Construct.
39: */
40: public TestPage() {
41: this .current = panel1;
42: add(current);
43:
44: add(new PageLink("link", new IPageLink() {
45: private static final long serialVersionUID = 1L;
46:
47: public Page getPage() {
48: replacePanel();
49: return TestPage.this ;
50: }
51:
52: public Class getPageIdentity() {
53: return TestPage.this .getClass();
54: }
55: }));
56: }
57:
58: /**
59: *
60: */
61: public void replacePanel() {
62: this.current = (this.current == this.panel1 ? this.panel2
63: : this.panel1);
64: replace(this.current);
65: }
66: }
|