KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > html > dom > HTMLInputElementImpl


1 /*
2  * Copyright 1999,2000,2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.html.dom;
17
18 import org.w3c.dom.html.HTMLInputElement;
19
20 /**
21  * @xerces.internal
22  * @version $Revision: 1.9 $ $Date: 2005/04/18 01:04:17 $
23  * @author <a HREF="mailto:arkin@exoffice.com">Assaf Arkin</a>
24  * @see org.w3c.dom.html.HTMLInputElement
25  * @see org.apache.xerces.dom.ElementImpl
26  */

27 public class HTMLInputElementImpl
28     extends HTMLElementImpl
29     implements HTMLInputElement, HTMLFormControl
30 {
31
32     private static final long serialVersionUID = 3905799764707980082L;
33
34     public String JavaDoc getDefaultValue()
35     {
36         // ! NOT FULLY IMPLEMENTED !
37
return getAttribute( "defaultValue" );
38     }
39     
40     
41     public void setDefaultValue( String JavaDoc defaultValue )
42     {
43         // ! NOT FULLY IMPLEMENTED !
44
setAttribute( "defaultValue", defaultValue );
45     }
46     
47     
48     public boolean getDefaultChecked()
49     {
50         // ! NOT FULLY IMPLEMENTED !
51
return getBinary( "defaultChecked" );
52     }
53     
54     
55     public void setDefaultChecked( boolean defaultChecked )
56     {
57         // ! NOT FULLY IMPLEMENTED !
58
setAttribute( "defaultChecked", defaultChecked );
59     }
60   
61     
62     public String JavaDoc getAccept()
63     {
64         return getAttribute( "accept" );
65     }
66     
67     
68     public void setAccept( String JavaDoc accept )
69     {
70         setAttribute( "accept", accept );
71     }
72     
73     
74     public String JavaDoc getAccessKey()
75     {
76         String JavaDoc accessKey;
77         
78         // Make sure that the access key is a single character.
79
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 JavaDoc accessKey )
87     {
88         // Make sure that the access key is a single character.
89
if ( accessKey != null && accessKey.length() > 1 )
90             accessKey = accessKey.substring( 0, 1 );
91         setAttribute( "accesskey", accessKey );
92     }
93     
94     
95     public String JavaDoc getAlign()
96     {
97         return capitalize( getAttribute( "align" ) );
98     }
99     
100     
101     public void setAlign( String JavaDoc align )
102     {
103         setAttribute( "align", align );
104     }
105     
106     
107     public String JavaDoc getAlt()
108     {
109         return getAttribute( "alt" );
110     }
111     
112     
113     public void setAlt( String JavaDoc 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 JavaDoc getName()
156     {
157         return getAttribute( "name" );
158     }
159     
160     
161     public void setName( String JavaDoc 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 JavaDoc getSize()
180     {
181         return getAttribute( "size" );
182     }
183     
184     
185     public void setSize( String JavaDoc size )
186     {
187         setAttribute( "size", size );
188     }
189     
190     
191     public String JavaDoc getSrc()
192     {
193         return getAttribute( "src" );
194     }
195     
196     
197     public void setSrc( String JavaDoc 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 JavaDoc 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 JavaDoc getType()
223     {
224         return getAttribute( "type" );
225     }
226     
227     
228     public String JavaDoc getUseMap()
229     {
230         return getAttribute( "useMap" );
231     }
232     
233     
234     public void setUseMap( String JavaDoc useMap )
235     {
236         setAttribute( "useMap", useMap );
237     }
238     
239     
240     public String JavaDoc getValue()
241     {
242         return getAttribute( "value" );
243     }
244     
245     
246     public void setValue( String JavaDoc value )
247     {
248         setAttribute( "value", value );
249     }
250     
251     
252     public void blur()
253     {
254         // No scripting in server-side DOM. This method is moot.
255
}
256     
257     
258     public void focus()
259     {
260         // No scripting in server-side DOM. This method is moot.
261
}
262     
263     
264     public void select()
265     {
266         // No scripting in server-side DOM. This method is moot.
267
}
268     
269     
270     public void click()
271     {
272         // No scripting in server-side DOM. This method is moot.
273
}
274
275   
276     /**
277      * Constructor requires owner document.
278      *
279      * @param owner The owner HTML document
280      */

281     public HTMLInputElementImpl( HTMLDocumentImpl owner, String JavaDoc name )
282     {
283         super( owner, name );
284     }
285
286
287 }
288
289
290
Popular Tags