01: /*
02: * $Id: MyLabel.java 457783 2005-10-02 10:06:33Z jcompagner $
03: * $Revision: 457783 $
04: * $Date: 2005-10-02 12:06:33 +0200 (Sun, 02 Oct 2005) $
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.WebComponent;
22:
23: /**
24: * Dummy component used for ComponentCreateTagTest
25: *
26: * @author Juergen Donnerstag
27: */
28: public class MyLabel extends WebComponent {
29: private static final long serialVersionUID = 1L;
30:
31: private String text = "";
32:
33: /**
34: * Construct.
35: * @param id
36: */
37: public MyLabel(final String id) {
38: super (id);
39: }
40:
41: /**
42: * Sets text.
43: * @param text
44: */
45: public void setText(final String text) {
46: this .text = text;
47: }
48:
49: /**
50: * Allows modification of component tag.
51: * @param tag The tag to modify
52: * @see wicket.Component#onComponentTag(wicket.markup.ComponentTag)
53: */
54: protected final void onComponentTag(final ComponentTag tag) {
55: checkComponentTag(tag, "component");
56: super .onComponentTag(tag);
57: }
58:
59: /**
60: * @see wicket.Component#onComponentTagBody(wicket.markup.MarkupStream,
61: * wicket.markup.ComponentTag)
62: */
63: protected void onComponentTagBody(final MarkupStream markupStream,
64: final ComponentTag openTag) {
65: replaceComponentTagBody(markupStream, openTag, text);
66: }
67: }
|