1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class Frame extends MultiPartElement implements Printable 70 { 71 public final static String YES = "YES"; 72 public final static String NO = "NO"; 73 public final static String AUTO = "AUTO"; 74 public final static String yes = "yes"; 75 public final static String no = "no"; 76 public final static String auto = "auto"; 77 78 81 { 82 setElementType("frame"); 83 setNeedClosingTag(false); 84 } 85 88 public Frame() 89 { 90 } 91 92 96 public Frame(Element element) 97 { 98 addElement(element); 99 } 100 101 105 public Frame(String element) 106 { 107 addElement(element); 108 } 109 110 115 public Frame(Element element, String name) 116 { 117 addElement(element); 118 setName(name); 119 } 120 121 126 public Frame(String element, String name) 127 { 128 addElement(element); 129 setName(name); 130 } 131 132 138 public Frame(Element element, String name, String src) 139 { 140 addElement(element); 141 setName(name); 142 setSrc(src); 143 } 144 145 151 public Frame(String element, String name, String src) 152 { 153 addElement(element); 154 setName(name); 155 setSrc(src); 156 } 157 158 162 public Frame setLongDesc(String longdesc) 163 { 164 addAttribute("longdesc",longdesc); 165 return this; 166 } 167 168 172 public Frame setName(String name) 173 { 174 addAttribute("name",name); 175 return this; 176 } 177 178 182 public Frame setSrc(String src) 183 { 184 addAttribute("src",src); 185 return this; 186 } 187 188 192 public Frame setFrameBorder(boolean frameborder) 193 { 194 if (frameborder) 195 addAttribute("frameborder",Integer.toString(1)); 196 else 197 addAttribute("frameborder",Integer.toString(0)); 198 return this; 199 } 200 201 205 public Frame setMarginWidth(int marginwidth) 206 { 207 setMarginWidth(Integer.toString(marginwidth)); 208 return this; 209 } 210 211 215 public Frame setMarginWidth(String marginwidth) 216 { 217 addAttribute("marginwidth",marginwidth); 218 return this; 219 } 220 221 225 public Frame setMarginHeight(int marginheight) 226 { 227 setMarginHeight(Integer.toString(marginheight)); 228 return this; 229 } 230 231 235 public Frame setMarginHeight(String marginheight) 236 { 237 addAttribute("marginheight",marginheight); 238 return this; 239 } 240 241 245 public Frame setScrolling(String scrolling) 246 { 247 addAttribute("scrolling",scrolling); 248 return this; 249 } 250 251 255 public Frame setNoResize(boolean noresize) 256 { 257 if ( noresize == true ) 258 addAttribute("noresize", NO_ATTRIBUTE_VALUE); 259 else 260 removeAttribute("noresize"); 261 262 return(this); 263 } 264 265 270 public Frame addElement(String hashcode,Element element) 271 { 272 addElementToRegistry(hashcode,element); 273 return(this); 274 } 275 276 281 public Frame addElement(String hashcode,String element) 282 { 283 addElementToRegistry(hashcode,element); 284 return(this); 285 } 286 287 291 public Frame addElement(Element element) 292 { 293 addElementToRegistry(element); 294 return(this); 295 } 296 297 301 public Frame addElement(String element) 302 { 303 addElementToRegistry(element); 304 return(this); 305 } 306 310 public Frame removeElement(String hashcode) 311 { 312 removeElementFromRegistry(hashcode); 313 return(this); 314 } 315 } 316 | Popular Tags |