01: /*
02: * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar
03: * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17
04: * Mar 2006) $
05: *
06: * ==============================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
08: * use this file except in compliance with the License. You may obtain a copy of
09: * 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, WITHOUT
15: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16: * License for the specific language governing permissions and limitations under
17: * the License.
18: */
19: package wicket.util.tester.apps_5;
20:
21: import wicket.markup.html.WebPage;
22: import wicket.markup.html.form.Form;
23: import wicket.markup.html.form.TextField;
24: import wicket.model.CompoundPropertyModel;
25:
26: /**
27: * Contains a form with a textfield on it. Also contains markup for a link, but
28: * you must add the link yourself
29: *
30: * @author Frank Bille
31: */
32: public class MockPageWithFormAndLink extends WebPage {
33: /**
34: * @author Frank Bille
35: */
36: public static class MockPojo {
37: private String name;
38:
39: /**
40: * @return name
41: */
42: public String getName() {
43: return name;
44: }
45:
46: /**
47: * @param name
48: */
49: public void setName(String name) {
50: this .name = name;
51: }
52: }
53:
54: private static final long serialVersionUID = 1L;
55: private Form form;
56:
57: private TextField nameField;
58:
59: /**
60: * Construct.
61: *
62: * @param mockPojo
63: */
64: public MockPageWithFormAndLink(MockPojo mockPojo) {
65: form = new Form("form", new CompoundPropertyModel(mockPojo));
66: add(form);
67: nameField = new TextField("name");
68: form.add(nameField);
69: }
70:
71: /**
72: * @return the form component
73: */
74: public Form getForm() {
75: return form;
76: }
77:
78: /**
79: * @return the name text field
80: */
81: public TextField getNameField() {
82: return nameField;
83: }
84:
85: /**
86: * @param form
87: */
88: public void setForm(Form form) {
89: this .form = form;
90: }
91:
92: /**
93: * @param name
94: */
95: public void setNameField(TextField name) {
96: this.nameField = name;
97: }
98: }
|