01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.tags.rendering;
20:
21: import org.apache.beehive.netui.tags.html.HtmlConstants;
22:
23: import java.util.HashMap;
24:
25: /**
26: *
27: */
28: public abstract class TBodyTag extends TagHtmlBase {
29:
30: public static void add(HashMap html, HashMap htmlQuirks,
31: HashMap xhtml) {
32: html
33: .put(
34: TBODY_TAG,
35: new org.apache.beehive.netui.tags.rendering.TBodyTag.Rendering());
36: htmlQuirks
37: .put(
38: TBODY_TAG,
39: new org.apache.beehive.netui.tags.rendering.TBodyTag.Rendering());
40: xhtml
41: .put(
42: TBODY_TAG,
43: new org.apache.beehive.netui.tags.rendering.TBodyTag.Rendering());
44: }
45:
46: public static class State extends AbstractHtmlState {
47: public void clear() {
48: super .clear();
49: }
50: }
51:
52: private static class Rendering extends TBodyTag implements
53: HtmlConstants {
54: public void doStartTag(AbstractRenderAppender sb,
55: AbstractTagState renderState) {
56: assert (sb != null) : "Parameter 'sb' must not be null";
57: assert (renderState != null) : "Parameter 'renderState' must not be null";
58: assert (renderState instanceof State) : "Paramater 'renderState' must be an instance of TBodyTag.State";
59:
60: State state = (State) renderState;
61:
62: renderTag(sb, TBODY);
63:
64: renderAttribute(sb, ID, state.id);
65: renderAttribute(sb, CLASS, state.styleClass);
66:
67: renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
68: renderAttribute(sb, STYLE, state.style);
69: renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb,
70: state);
71: sb.append(">");
72: }
73:
74: public void doEndTag(AbstractRenderAppender sb) {
75: renderEndTag(sb, TBODY);
76: }
77: }
78: }
|