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