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