1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 73 public class P extends MultiPartElement implements Printable, MouseEvents, KeyEvents 74 { 75 78 { 79 setElementType("p"); 80 setNeedClosingTag(false); 81 } 82 86 public P() 87 { 88 } 89 90 96 public P(String align) 97 { 98 setAlign(align); 99 } 100 101 108 public P(String value, String align) 109 { 110 setAlign(align); 111 addElement(value); 112 } 113 114 118 public P setAlign(String align) 119 { 120 addAttribute("align",align); 121 return this; 122 } 123 124 129 public P addElement(String hashcode,Element element) 130 { 131 addElementToRegistry(hashcode,element); 132 return(this); 133 } 134 135 140 public P addElement(String hashcode,String element) 141 { 142 addElementToRegistry(hashcode,element); 143 return(this); 144 } 145 149 public P addElement(Element element) 150 { 151 addElementToRegistry(element); 152 return(this); 153 } 154 155 159 public P addElement(String element) 160 { 161 addElementToRegistry(element); 162 return(this); 163 } 164 168 public P removeElement(String hashcode) 169 { 170 removeElementFromRegistry(hashcode); 171 return(this); 172 } 173 174 180 public void setOnClick(String script) 181 { 182 addAttribute ( "onClick", script ); 183 } 184 190 public void setOnDblClick(String script) 191 { 192 addAttribute ( "onDblClick", script ); 193 } 194 200 public void setOnMouseDown(String script) 201 { 202 addAttribute ( "onMouseDown", script ); 203 } 204 210 public void setOnMouseUp(String script) 211 { 212 addAttribute ( "onMouseUp", script ); 213 } 214 220 public void setOnMouseOver(String script) 221 { 222 addAttribute ( "onMouseOver", script ); 223 } 224 230 public void setOnMouseMove(String script) 231 { 232 addAttribute ( "onMouseMove", script ); 233 } 234 240 public void setOnMouseOut(String script) 241 { 242 addAttribute ( "onMouseOut", script ); 243 } 244 245 251 public void setOnKeyPress(String script) 252 { 253 addAttribute ( "onKeyPress", script ); 254 } 255 256 262 public void setOnKeyDown(String script) 263 { 264 addAttribute ( "onKeyDown", script ); 265 } 266 267 273 public void setOnKeyUp(String script) 274 { 275 addAttribute ( "onKeyUp", script ); 276 } 277 } 278 | Popular Tags |