1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 71 public class a extends MultiPartElement implements Printable, FocusEvents, MouseEvents, KeyEvents 72 { 73 76 { 77 setElementType("a"); 78 setCase(LOWERCASE); setAttributeQuote(true); } 81 82 86 public a() 87 { 88 } 89 90 95 public a(String href) 96 { 97 setHref(href); 98 } 99 100 106 public a(String href, String value) 107 { 108 setHref(href); 109 addElement(value); 110 } 111 112 118 public a(String href, Element value) 119 { 120 setHref(href); 121 addElement(value); 122 } 123 124 131 public a(String href, String name, String value) 132 { 133 setHref(href); 134 setName(name); 135 addElement(value); 136 } 137 138 145 public a(String href, String name, Element value) 146 { 147 setHref(href); 148 setName(name); 149 addElement(value); 150 } 151 152 160 public a(String href, String name, String target, Element value) 161 { 162 setHref(href); 163 setName(name); 164 setTarget(target); 165 addElement(value); 166 } 167 168 176 public a(String href, String name, String target, String value) 177 { 178 setHref(href); 179 setName(name); 180 setTarget(target); 181 addElement(value); 182 } 183 184 193 public a(String href, String name, String target, String lang, 194 String value) 195 { 196 setHref(href); 197 setName(name); 198 setTarget(target); 199 setLang(lang); 200 addElement(value); 201 } 202 203 212 public a(String href, String name, String target, String lang, 213 Element value) 214 { 215 setHref(href); 216 setName(name); 217 setTarget(target); 218 setLang(lang); 219 addElement(value); 220 } 221 222 226 public a setHref(String href) 227 { 228 addAttribute("href",href); 229 return this; 230 } 231 232 236 public a setName(String name) 237 { 238 addAttribute("name",name); 239 return this; 240 } 241 242 246 public a setTarget(String target) 247 { 248 addAttribute("target",target); 249 return this; 250 } 251 252 256 public a setRel(String rel) 257 { 258 addAttribute("rel",rel); 259 return this; 260 } 261 262 266 public a setRev(String rev) 267 { 268 addAttribute("rev",rev); 269 return this; 270 } 271 272 276 public Element setLang(String lang) 277 { 278 addAttribute("lang",lang); 279 addAttribute("xml:lang",lang); 280 return this; 281 } 282 283 287 public a addElement(Element element) 288 { 289 addElementToRegistry(element); 290 return(this); 291 } 292 293 297 public a addElement(String element) 298 { 299 addElementToRegistry(element); 300 return(this); 301 } 302 303 308 public a addElement(String hashcode,Element element) 309 { 310 addElementToRegistry(hashcode,element); 311 return(this); 312 } 313 314 319 public a addElement(String hashcode,String element) 320 { 321 addElementToRegistry(hashcode,element); 322 return(this); 323 } 324 325 329 public a removeElement(String hashcode) 330 { 331 removeElementFromRegistry(hashcode); 332 return(this); 333 } 334 335 343 public void setOnFocus(String script) 344 { 345 addAttribute ( "onfocus", script ); 346 } 347 348 355 public void setOnBlur(String script) 356 { 357 addAttribute ( "onblur", script ); 358 } 359 360 366 public void setOnClick(String script) 367 { 368 addAttribute ( "onclick", script ); 369 } 370 371 377 public void setOnDblClick(String script) 378 { 379 addAttribute ( "ondblclick", script ); 380 } 381 382 388 public void setOnMouseDown(String script) 389 { 390 addAttribute ( "onmousedown", script ); 391 } 392 393 399 public void setOnMouseUp(String script) 400 { 401 addAttribute ( "onnlouseup", script ); 402 } 403 404 410 public void setOnMouseOver(String script) 411 { 412 addAttribute ( "onmouseover", script ); 413 } 414 415 421 public void setOnMouseMove(String script) 422 { 423 addAttribute ( "onmousemove", script ); 424 } 425 426 432 public void setOnMouseOut(String script) 433 { 434 addAttribute ( "onmouseout", script ); 435 } 436 437 443 public void setOnKeyPress(String script) 444 { 445 addAttribute ( "onkeypress", script ); 446 } 447 448 454 public void setOnKeyDown(String script) 455 { 456 addAttribute ( "onkeydown", script ); 457 } 458 459 465 public void setOnKeyUp(String script) 466 { 467 addAttribute ( "onkeyup", script ); 468 } 469 470 473 public boolean getNeedLineBreak() 474 { 475 java.util.Enumeration enum = elements(); 476 int i=0; 477 int j=0; 478 while(enum.hasMoreElements()) 479 { 480 j++; 481 Object obj = enum.nextElement(); 482 if( obj instanceof img ) 483 i++; 484 } 485 if ( i==j) 486 return false; 487 return true; 488 } 489 } 490 | Popular Tags |