1 57 package org.enhydra.xml.lazydom.html; 58 import org.enhydra.xml.lazydom.LazyElement; 59 import org.enhydra.xml.lazydom.LazyElementNoNS; 60 import org.w3c.dom.html.HTMLInputElement; 61 62 63 69 public class HTMLInputElementImpl 70 extends LazyHTMLElement 71 implements HTMLInputElement, HTMLFormControl 72 { 73 74 75 public String getDefaultValue() 76 { 77 return getAttribute( "defaultValue" ); 79 } 80 81 82 public void setDefaultValue( String defaultValue ) 83 { 84 setAttribute( "defaultValue", defaultValue ); 86 } 87 88 89 public boolean getDefaultChecked() 90 { 91 return getBinary( "defaultChecked" ); 93 } 94 95 96 public void setDefaultChecked( boolean defaultChecked ) 97 { 98 setAttribute( "defaultChecked", defaultChecked ); 100 } 101 102 103 public String getAccept() 104 { 105 return getAttribute( "accept" ); 106 } 107 108 109 public void setAccept( String accept ) 110 { 111 setAttribute( "accept", accept ); 112 } 113 114 115 public String getAccessKey() 116 { 117 String accessKey; 118 119 accessKey = getAttribute( "accesskey" ); 121 if ( accessKey != null && accessKey.length() > 1 ) 122 accessKey = accessKey.substring( 0, 1 ); 123 return accessKey; 124 } 125 126 127 public void setAccessKey( String accessKey ) 128 { 129 if ( accessKey != null && accessKey.length() > 1 ) 131 accessKey = accessKey.substring( 0, 1 ); 132 setAttribute( "accesskey", accessKey ); 133 } 134 135 136 public String getAlign() 137 { 138 return capitalize( getAttribute( "align" ) ); 139 } 140 141 142 public void setAlign( String align ) 143 { 144 setAttribute( "align", align ); 145 } 146 147 148 public String getAlt() 149 { 150 return getAttribute( "alt" ); 151 } 152 153 154 public void setAlt( String alt ) 155 { 156 setAttribute( "alt", alt ); 157 } 158 159 160 public boolean getChecked() 161 { 162 return getBinary( "checked" ); 163 } 164 165 166 public void setChecked( boolean checked ) 167 { 168 setAttribute( "checked", checked ); 169 } 170 171 172 public boolean getDisabled() 173 { 174 return getBinary( "disabled" ); 175 } 176 177 178 public void setDisabled( boolean disabled ) 179 { 180 setAttribute( "disabled", disabled ); 181 } 182 183 184 public int getMaxLength() 185 { 186 return getInteger( getAttribute( "maxlength" ) ); 187 } 188 189 190 public void setMaxLength( int maxLength ) 191 { 192 setAttribute( "maxlength", String.valueOf( maxLength ) ); 193 } 194 195 196 public String getName() 197 { 198 return getAttribute( "name" ); 199 } 200 201 202 public void setName( String name ) 203 { 204 setAttribute( "name", name ); 205 } 206 207 208 public boolean getReadOnly() 209 { 210 return getBinary( "readonly" ); 211 } 212 213 214 public void setReadOnly( boolean readOnly ) 215 { 216 setAttribute( "readonly", readOnly ); 217 } 218 219 220 public String getSize() 221 { 222 return getAttribute( "size" ); 223 } 224 225 226 public void setSize( String size ) 227 { 228 setAttribute( "size", size ); 229 } 230 231 232 public String getSrc() 233 { 234 return getAttribute( "src" ); 235 } 236 237 238 public void setSrc( String src ) 239 { 240 setAttribute( "src", src ); 241 } 242 243 244 public int getTabIndex() 245 { 246 try 247 { 248 return Integer.parseInt( getAttribute( "tabindex" ) ); 249 } 250 catch ( NumberFormatException except ) 251 { 252 return 0; 253 } 254 } 255 256 257 public void setTabIndex( int tabIndex ) 258 { 259 setAttribute( "tabindex", String.valueOf( tabIndex ) ); 260 } 261 262 263 public String getType() 264 { 265 return getAttribute( "type" ); 266 } 267 268 269 public String getUseMap() 270 { 271 return getAttribute( "useMap" ); 272 } 273 274 275 public void setUseMap( String useMap ) 276 { 277 setAttribute( "useMap", useMap ); 278 } 279 280 281 public String getValue() 282 { 283 return getAttribute( "value" ); 284 } 285 286 287 public void setValue( String value ) 288 { 289 setAttribute( "value", value ); 290 } 291 292 293 public void blur() 294 { 295 } 297 298 299 public void focus() 300 { 301 } 303 304 305 public void select() 306 { 307 } 309 310 311 public void click() 312 { 313 } 315 316 317 322 public HTMLInputElementImpl( LazyHTMLDocument owner, LazyElement template, String name ) 323 { 324 super( owner, template, name ); 325 } 326 327 328 } 329 330 331 | Popular Tags |