1 18 package org.apache.beehive.netui.tags.rendering; 19 20 import org.apache.beehive.netui.tags.html.HtmlConstants; 21 22 import java.util.HashMap ; 23 24 27 public abstract class DivTag extends TagHtmlBase 28 { 29 public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml) 30 { 31 html.put(DIV_TAG, new Rendering()); 32 htmlQuirks.put(DIV_TAG, new Rendering()); 33 xhtml.put(DIV_TAG, new Rendering()); 34 } 35 36 public static class State extends AbstractHtmlState 37 { 38 public void clear() 39 { 40 super.clear(); 41 } 42 } 43 44 private static class Rendering extends DivTag implements HtmlConstants 45 { 46 public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState) 47 { 48 assert(sb != null) : "Parameter 'sb' must not be null"; 49 assert(renderState != null) : "Parameter 'renderState' must not be null"; 50 assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SpanTag.State"; 51 52 State state = (State) renderState; 53 54 renderTag(sb, DIV); 55 renderAttribute(sb, ID, state.id); 56 renderAttribute(sb, CLASS, state.styleClass); 57 58 renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state); 59 renderAttribute(sb, STYLE, state.style); 60 renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state); 61 sb.append(">"); 62 } 63 64 public void doEndTag(AbstractRenderAppender sb) 65 { 66 renderEndTag(sb, DIV); 67 } 68 } 69 } 70 | Popular Tags |