01: /*
02: * $Id: WicketTagComponentResolver.java,v 1.4 2005/01/18 08:04:29 jonathanlocke
03: * Exp $ $Revision: 459833 $ $Date: 2005/12/27 10:38:52 $
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.internal;
19:
20: import wicket.MarkupContainer;
21: import wicket.markup.ComponentTag;
22: import wicket.markup.MarkupStream;
23: import wicket.markup.html.WebPage;
24: import wicket.markup.html.basic.Label;
25: import wicket.markup.resolver.IComponentResolver;
26:
27: /**
28: *
29: * @author svenmeier
30: */
31: public class ComponentResolvingPage extends WebPage implements
32: IComponentResolver {
33: private static final long serialVersionUID = 1L;
34:
35: /** onEndRequestWasCalledOnAutoAddedComponent */
36: public boolean onEndRequestWasCalledOnAutoAddedComponent = false;
37:
38: /**
39: * Construct.
40: */
41: public ComponentResolvingPage() {
42: }
43:
44: /**
45: *
46: * @see wicket.markup.resolver.IComponentResolver#resolve(wicket.MarkupContainer,
47: * wicket.markup.MarkupStream, wicket.markup.ComponentTag)
48: */
49: public boolean resolve(final MarkupContainer container,
50: final MarkupStream markupStream, final ComponentTag tag) {
51: if ("test".equals(tag.getId())) {
52: autoAdd(new Label("test", "TEST") {
53: private static final long serialVersionUID = 1L;
54:
55: protected void onEndRequest() {
56: onEndRequestWasCalledOnAutoAddedComponent = true;
57: }
58: });
59: return true;
60: }
61: return false;
62: }
63: }
|