1 16 package org.apache.html.dom; 17 18 import org.w3c.dom.html.HTMLInputElement; 19 20 27 public class HTMLInputElementImpl 28 extends HTMLElementImpl 29 implements HTMLInputElement, HTMLFormControl 30 { 31 32 private static final long serialVersionUID = 3905799764707980082L; 33 34 public String getDefaultValue() 35 { 36 return getAttribute( "defaultValue" ); 38 } 39 40 41 public void setDefaultValue( String defaultValue ) 42 { 43 setAttribute( "defaultValue", defaultValue ); 45 } 46 47 48 public boolean getDefaultChecked() 49 { 50 return getBinary( "defaultChecked" ); 52 } 53 54 55 public void setDefaultChecked( boolean defaultChecked ) 56 { 57 setAttribute( "defaultChecked", defaultChecked ); 59 } 60 61 62 public String getAccept() 63 { 64 return getAttribute( "accept" ); 65 } 66 67 68 public void setAccept( String accept ) 69 { 70 setAttribute( "accept", accept ); 71 } 72 73 74 public String getAccessKey() 75 { 76 String accessKey; 77 78 accessKey = getAttribute( "accesskey" ); 80 if ( accessKey != null && accessKey.length() > 1 ) 81 accessKey = accessKey.substring( 0, 1 ); 82 return accessKey; 83 } 84 85 86 public void setAccessKey( String accessKey ) 87 { 88 if ( accessKey != null && accessKey.length() > 1 ) 90 accessKey = accessKey.substring( 0, 1 ); 91 setAttribute( "accesskey", accessKey ); 92 } 93 94 95 public String getAlign() 96 { 97 return capitalize( getAttribute( "align" ) ); 98 } 99 100 101 public void setAlign( String align ) 102 { 103 setAttribute( "align", align ); 104 } 105 106 107 public String getAlt() 108 { 109 return getAttribute( "alt" ); 110 } 111 112 113 public void setAlt( String alt ) 114 { 115 setAttribute( "alt", alt ); 116 } 117 118 119 public boolean getChecked() 120 { 121 return getBinary( "checked" ); 122 } 123 124 125 public void setChecked( boolean checked ) 126 { 127 setAttribute( "checked", checked ); 128 } 129 130 131 public boolean getDisabled() 132 { 133 return getBinary( "disabled" ); 134 } 135 136 137 public void setDisabled( boolean disabled ) 138 { 139 setAttribute( "disabled", disabled ); 140 } 141 142 143 public int getMaxLength() 144 { 145 return getInteger( getAttribute( "maxlength" ) ); 146 } 147 148 149 public void setMaxLength( int maxLength ) 150 { 151 setAttribute( "maxlength", String.valueOf( maxLength ) ); 152 } 153 154 155 public String getName() 156 { 157 return getAttribute( "name" ); 158 } 159 160 161 public void setName( String name ) 162 { 163 setAttribute( "name", name ); 164 } 165 166 167 public boolean getReadOnly() 168 { 169 return getBinary( "readonly" ); 170 } 171 172 173 public void setReadOnly( boolean readOnly ) 174 { 175 setAttribute( "readonly", readOnly ); 176 } 177 178 179 public String getSize() 180 { 181 return getAttribute( "size" ); 182 } 183 184 185 public void setSize( String size ) 186 { 187 setAttribute( "size", size ); 188 } 189 190 191 public String getSrc() 192 { 193 return getAttribute( "src" ); 194 } 195 196 197 public void setSrc( String src ) 198 { 199 setAttribute( "src", src ); 200 } 201 202 203 public int getTabIndex() 204 { 205 try 206 { 207 return Integer.parseInt( getAttribute( "tabindex" ) ); 208 } 209 catch ( NumberFormatException except ) 210 { 211 return 0; 212 } 213 } 214 215 216 public void setTabIndex( int tabIndex ) 217 { 218 setAttribute( "tabindex", String.valueOf( tabIndex ) ); 219 } 220 221 222 public String getType() 223 { 224 return getAttribute( "type" ); 225 } 226 227 228 public String getUseMap() 229 { 230 return getAttribute( "useMap" ); 231 } 232 233 234 public void setUseMap( String useMap ) 235 { 236 setAttribute( "useMap", useMap ); 237 } 238 239 240 public String getValue() 241 { 242 return getAttribute( "value" ); 243 } 244 245 246 public void setValue( String value ) 247 { 248 setAttribute( "value", value ); 249 } 250 251 252 public void blur() 253 { 254 } 256 257 258 public void focus() 259 { 260 } 262 263 264 public void select() 265 { 266 } 268 269 270 public void click() 271 { 272 } 274 275 276 281 public HTMLInputElementImpl( HTMLDocumentImpl owner, String name ) 282 { 283 super( owner, name ); 284 } 285 286 287 } 288 289 290 | Popular Tags |