1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class PRE extends MultiPartElement implements MouseEvents, KeyEvents 70 { 71 74 { 75 setElementType("pre"); 76 setPrettyPrint(false); 77 } 78 79 83 public PRE() 84 { 85 } 86 87 93 public PRE(Element element) 94 { 95 addElement(element); 96 } 97 98 105 public PRE(String value, int width) 106 { 107 setWidth(width); 108 addElement(value); 109 } 110 111 118 public PRE(Element element, int width) 119 { 120 setWidth(width); 121 addElement(element); 122 } 123 124 131 public PRE(Element element, String width) 132 { 133 setWidth(width); 134 addElement(element); 135 } 136 137 143 public PRE(String value) 144 { 145 addElement(value); 146 } 147 148 152 public PRE setWidth(int width) 153 { 154 addAttribute("width",Integer.toString(width)); 155 return this; 156 } 157 158 162 public PRE setWidth(String width) 163 { 164 addAttribute("width",width); 165 return this; 166 } 167 168 173 public PRE addElement(String hashcode,Element element) 174 { 175 addElementToRegistry(hashcode,element); 176 return(this); 177 } 178 179 184 public PRE addElement(String hashcode,String element) 185 { 186 addElementToRegistry(hashcode,element); 187 return(this); 188 } 189 190 194 public PRE addElement(Element element) 195 { 196 addElementToRegistry(element); 197 return(this); 198 } 199 200 204 public PRE addElement(String element) 205 { 206 addElementToRegistry(element); 207 return(this); 208 } 209 213 public PRE removeElement(String hashcode) 214 { 215 removeElementFromRegistry(hashcode); 216 return(this); 217 } 218 219 225 public void setOnClick(String script) 226 { 227 addAttribute ( "onClick", script ); 228 } 229 235 public void setOnDblClick(String script) 236 { 237 addAttribute ( "onDblClick", script ); 238 } 239 245 public void setOnMouseDown(String script) 246 { 247 addAttribute ( "onMouseDown", script ); 248 } 249 255 public void setOnMouseUp(String script) 256 { 257 addAttribute ( "onMouseUp", script ); 258 } 259 265 public void setOnMouseOver(String script) 266 { 267 addAttribute ( "onMouseOver", script ); 268 } 269 275 public void setOnMouseMove(String script) 276 { 277 addAttribute ( "onMouseMove", script ); 278 } 279 285 public void setOnMouseOut(String script) 286 { 287 addAttribute ( "onMouseOut", script ); 288 } 289 290 296 public void setOnKeyPress(String script) 297 { 298 addAttribute ( "onKeyPress", script ); 299 } 300 301 307 public void setOnKeyDown(String script) 308 { 309 addAttribute ( "onKeyDown", script ); 310 } 311 312 318 public void setOnKeyUp(String script) 319 { 320 addAttribute ( "onKeyUp", script ); 321 } 322 } 323 | Popular Tags |