1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class pre extends MultiPartElement implements MouseEvents, KeyEvents 71 { 72 75 { 76 setElementType("pre"); 77 setCase(LOWERCASE); 78 setAttributeQuote(true); 79 setPrettyPrint(false); 80 } 81 82 86 public pre() 87 { 88 } 89 90 96 public pre(Element element) 97 { 98 addElement(element); 99 } 100 101 108 public pre(String value, int width) 109 { 110 setWidth(width); 111 addElement(value); 112 } 113 114 121 public pre(Element element, int width) 122 { 123 setWidth(width); 124 addElement(element); 125 } 126 127 134 public pre(Element element, String width) 135 { 136 setWidth(width); 137 addElement(element); 138 } 139 140 146 public pre(String value) 147 { 148 addElement(value); 149 } 150 151 155 public pre setWidth(int width) 156 { 157 addAttribute("width",Integer.toString(width)); 158 return this; 159 } 160 161 165 public pre setWidth(String width) 166 { 167 addAttribute("width",width); 168 return this; 169 } 170 171 175 public Element setLang(String lang) 176 { 177 addAttribute("lang",lang); 178 addAttribute("xml:lang",lang); 179 return this; 180 } 181 182 187 public pre addElement(String hashcode,Element element) 188 { 189 addElementToRegistry(hashcode,element); 190 return(this); 191 } 192 193 198 public pre addElement(String hashcode,String element) 199 { 200 addElementToRegistry(hashcode,element); 201 return(this); 202 } 203 204 208 public pre addElement(Element element) 209 { 210 addElementToRegistry(element); 211 return(this); 212 } 213 214 218 public pre addElement(String element) 219 { 220 addElementToRegistry(element); 221 return(this); 222 } 223 227 public pre removeElement(String hashcode) 228 { 229 removeElementFromRegistry(hashcode); 230 return(this); 231 } 232 233 239 public void setOnClick(String script) 240 { 241 addAttribute ( "onclick", script ); 242 } 243 249 public void setOnDblClick(String script) 250 { 251 addAttribute ( "ondblclick", script ); 252 } 253 259 public void setOnMouseDown(String script) 260 { 261 addAttribute ( "onmousedown", script ); 262 } 263 269 public void setOnMouseUp(String script) 270 { 271 addAttribute ( "onmouseup", script ); 272 } 273 279 public void setOnMouseOver(String script) 280 { 281 addAttribute ( "onmouseover", script ); 282 } 283 289 public void setOnMouseMove(String script) 290 { 291 addAttribute ( "onmousemove", script ); 292 } 293 299 public void setOnMouseOut(String script) 300 { 301 addAttribute ( "onmouseout", script ); 302 } 303 304 310 public void setOnKeyPress(String script) 311 { 312 addAttribute ( "onkeypress", script ); 313 } 314 315 321 public void setOnKeyDown(String script) 322 { 323 addAttribute ( "onkeydown", script ); 324 } 325 326 332 public void setOnKeyUp(String script) 333 { 334 addAttribute ( "onkeyup", script ); 335 } 336 } 337 | Popular Tags |