1 23 24 package de.laures.cewolf.taglib.html; 25 26 import java.io.IOException ; 27 import java.io.Serializable ; 28 import java.io.Writer ; 29 30 34 public class HTMLImgTag extends AbstractHTMLBaseTag implements Serializable { 35 36 private final static String TAG_NAME = "IMG"; 37 38 39 protected int width = UNDEFINED_INT; 40 41 42 protected int height = UNDEFINED_INT; 43 44 45 protected String src = UNDEFINED_STR; 46 47 48 protected String alt = ""; 49 50 51 protected String longDesc = UNDEFINED_STR; 52 53 54 protected String useMap = UNDEFINED_STR; 55 56 57 protected String ismap = UNDEFINED_STR; 58 59 60 protected String align = UNDEFINED_STR; 61 62 63 protected int border = 0; 64 65 66 protected int hSpace = UNDEFINED_INT; 67 68 69 protected int vSpace = UNDEFINED_INT; 70 71 74 protected boolean forceSessionId = true; 75 76 79 protected boolean removeAfterRender = false; 80 81 88 89 public void writeAttributes(Writer wr){ 90 try { 91 super.writeAttributes(wr); 92 appendAttributeDeclaration(wr, this.border, "BORDER"); 93 appendAttributeDeclaration(wr, this.hSpace, "HSPACE"); 94 appendAttributeDeclaration(wr, this.height, "HEIGHT"); 95 appendAttributeDeclaration(wr, this.vSpace, "VSPACE"); 96 appendAttributeDeclaration(wr, this.width, "WIDTH"); 97 appendAttributeDeclaration(wr, this.align, "ALIGN"); 98 appendAttributeDeclaration(wr, this.alt, "ALT"); 99 appendAttributeDeclaration(wr, this.ismap, "ISMAP"); 100 appendAttributeDeclaration(wr, this.longDesc, "LONGDESC"); 101 appendAttributeDeclaration(wr, this.src, "SRC"); 102 appendAttributeDeclaration(wr, this.useMap, "USEMAP"); 103 } catch(IOException ioex){ 104 ioex.printStackTrace(); 105 } 106 } 107 108 protected void reset(){ 109 src = UNDEFINED_STR; 112 alt = ""; 113 longDesc = UNDEFINED_STR; 114 useMap = UNDEFINED_STR; 115 ismap = UNDEFINED_STR; 116 align = UNDEFINED_STR; 117 border = 0; 118 hSpace = UNDEFINED_INT; 119 vSpace = UNDEFINED_INT; 120 forceSessionId = true; 121 removeAfterRender = false; 122 super.reset(); 123 } 124 125 128 public void setWidth(int width) { 129 this.width = width; 130 } 131 132 135 public void setHeight(int height) { 136 this.height = height; 137 } 138 139 142 public void setSrc(String src) { 143 this.src = src; 144 } 145 146 149 public void setAlt(String alt) { 150 this.alt = alt; 151 } 152 153 156 public void setLongdesc(String longDesc) { 157 this.longDesc = longDesc; 158 } 159 160 163 public void setUsemap(String useMap) { 164 this.useMap = useMap; 165 } 166 167 170 public void setIsmap(String ismap) { 171 this.ismap = ismap; 172 } 173 174 177 public void setAlign(String align) { 178 this.align = align; 179 } 180 181 184 public void setBorder(int border) { 185 this.border = border; 186 } 187 188 191 public void setHspace(int hSpace) { 192 this.hSpace = hSpace; 193 } 194 195 198 public void setVspace(int vSpace) { 199 this.vSpace = vSpace; 200 } 201 202 protected String getTagName() { 203 return TAG_NAME; 204 } 205 206 protected boolean hasBody() { 207 return false; 208 } 209 210 protected boolean wellFormed() { 211 return false; 212 } 213 214 215 218 public boolean isForceSessionId() { 219 return forceSessionId; 220 } 221 222 225 public void setForceSessionId(boolean forceSessionId) { 226 this.forceSessionId = forceSessionId; 227 } 228 229 232 public boolean isRemoveAfterRender() { 233 return removeAfterRender; 234 } 235 236 239 public void setRemoveAfterRender(boolean removeAfterRender) { 240 this.removeAfterRender = removeAfterRender; 241 } 242 } 243 | Popular Tags |