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 28 public abstract class SpanTag extends TagHtmlBase 29 { 30 public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml) 31 { 32 html.put(SPAN_TAG, new Rendering()); 33 htmlQuirks.put(SPAN_TAG, new Rendering()); 34 xhtml.put(SPAN_TAG, new Rendering()); 35 } 36 37 public static class State extends AbstractHtmlState 38 { 39 public void clear() 40 { 41 super.clear(); 42 } 43 } 44 45 private static class Rendering extends SpanTag implements HtmlConstants 46 { 47 public void doStartTag(AbstractRenderAppender sb, AbstractTagState renderState) 48 { 49 assert(sb != null) : "Parameter 'sb' must not be null"; 50 assert(renderState != null) : "Parameter 'renderState' must not be null"; 51 assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SpanTag.State"; 52 53 State state = (State) renderState; 54 55 renderTag(sb, SPAN); 56 renderAttribute(sb, ID, state.id); 57 renderAttribute(sb, CLASS, state.styleClass); 58 59 renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state); 60 renderAttribute(sb, STYLE, state.style); 61 renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state); 62 sb.append(">"); 63 } 64 65 public void doEndTag(AbstractRenderAppender sb) 66 { 67 renderEndTag(sb, SPAN); 68 } 69 } 70 } 71 | Popular Tags |