1 12 package org.displaytag.tags; 13 14 import org.displaytag.util.HtmlAttributeMap; 15 import org.displaytag.util.MultipleHtmlAttribute; 16 import org.displaytag.util.TagConstants; 17 18 19 24 public abstract class HtmlTableTag extends TemplateTag 25 { 26 27 30 private HtmlAttributeMap attributeMap = new HtmlAttributeMap(); 31 32 36 public void setCellspacing(String value) 37 { 38 this.attributeMap.put(TagConstants.ATTRIBUTE_CELLSPACING, value); 39 } 40 41 45 public void setCellpadding(String value) 46 { 47 this.attributeMap.put(TagConstants.ATTRIBUTE_CELLPADDING, value); 48 } 49 50 54 public void setFrame(String value) 55 { 56 this.attributeMap.put(TagConstants.ATTRIBUTE_FRAME, value); 57 } 58 59 63 public void setRules(String value) 64 { 65 this.attributeMap.put(TagConstants.ATTRIBUTE_RULES, value); 66 } 67 68 72 public void setStyle(String value) 73 { 74 this.attributeMap.put(TagConstants.ATTRIBUTE_STYLE, value); 75 } 76 77 81 public void setSummary(String value) 82 { 83 this.attributeMap.put(TagConstants.ATTRIBUTE_SUMMARY, value); 84 } 85 86 90 public void setClass(String value) 91 { 92 this.attributeMap.put(TagConstants.ATTRIBUTE_CLASS, new MultipleHtmlAttribute(value)); 93 } 94 95 99 public void setHtmlId(String value) 100 { 101 this.attributeMap.put(TagConstants.ATTRIBUTE_ID, value); 102 } 103 104 108 public void addClass(String value) 109 { 110 Object classAttributes = this.attributeMap.get(TagConstants.ATTRIBUTE_CLASS); 111 112 if (classAttributes == null) 113 { 114 this.attributeMap.put(TagConstants.ATTRIBUTE_CLASS, new MultipleHtmlAttribute(value)); 115 } 116 else 117 { 118 ((MultipleHtmlAttribute) classAttributes).addAttributeValue(value); 119 } 120 } 121 122 125 public void release() 126 { 127 this.attributeMap.clear(); 128 super.release(); 129 } 130 131 136 public HtmlAttributeMap getAttributeMap() 137 { 138 return this.attributeMap; 139 } 140 141 } | Popular Tags |