01: /*
02: * $Id: HeaderSectionMyLabel.java 459487 2006-02-23 20:41:28Z jdonnerstag $
03: * $Revision: 459487 $
04: * $Date: 2006-02-23 21:41:28 +0100 (Thu, 23 Feb 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.parser.filter;
20:
21: import wicket.markup.ComponentTag;
22: import wicket.markup.MarkupStream;
23: import wicket.markup.html.WebMarkupContainerWithAssociatedMarkup;
24: import wicket.markup.html.internal.HtmlHeaderContainer;
25: import wicket.model.Model;
26:
27: /**
28: * Mock page for testing.
29: *
30: * @author Chris Turner
31: */
32: public class HeaderSectionMyLabel extends
33: WebMarkupContainerWithAssociatedMarkup {
34: private static final long serialVersionUID = 1L;
35:
36: /**
37: * Construct.
38: * @param id
39: * @param label
40: */
41: public HeaderSectionMyLabel(final String id, final String label) {
42: super (id, new Model(label));
43: }
44:
45: /**
46: * @see wicket.Component#onComponentTagBody(wicket.markup.MarkupStream,
47: * wicket.markup.ComponentTag)
48: */
49: protected void onComponentTagBody(final MarkupStream markupStream,
50: final ComponentTag openTag) {
51: replaceComponentTagBody(markupStream, openTag,
52: getModelObjectAsString());
53: }
54:
55: /**
56: * This label renders its markup the normal way, and is still able
57: * to take and render the header tag from an associated markup file.
58: *
59: * @see wicket.Component#renderHead(wicket.markup.html.internal.HtmlHeaderContainer)
60: */
61: public void renderHead(HtmlHeaderContainer container) {
62: this.renderHeadFromAssociatedMarkupFile(container);
63: super.renderHead(container);
64: }
65: }
|