KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom > html > HTMLTextAreaElementImpl


1 /**
2  * org/ozone-db/xml/dom/html/HTMLTextAreaElementImpl.java
3  *
4  * The contents of this file are subject to the OpenXML Public
5  * License Version 1.0; you may not use this file except in compliance
6  * with the License. You may obtain a copy of the License at
7  * http://www.openxml.org/license.html
8  *
9  * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
10  * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
11  * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
12  * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
13  * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
14  * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
15  *
16  * The Initial Developer of this code under the License is Assaf Arkin.
17  * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
18  * All Rights Reserved.
19  */

20
21
22 package org.ozoneDB.xml.dom.html;
23
24
25 import org.ozoneDB.xml.dom.ElementImpl;
26 import org.w3c.dom.html.HTMLTextAreaElement;
27
28
29 /**
30  * @version $Revision: 1.2 $ $Date: 2003/11/20 23:18:42 $
31  * @author <a HREF="mailto:arkin@trendline.co.il">Assaf Arkin</a>
32  * @see org.w3c.dom.html.HTMLTextAreaElement
33  * @see ElementImpl
34  */

35 public final class HTMLTextAreaElementImpl extends HTMLElementImpl implements HTMLTextAreaElement, HTMLFormControl {
36
37
38     public String JavaDoc getDefaultValue() {
39         // ! NOT FULLY IMPLEMENTED !
40
return getAttribute( "default-value" );
41     }
42
43
44     public void setDefaultValue( String JavaDoc defaultValue ) {
45         // ! NOT FULLY IMPLEMENTED !
46
setAttribute( "default-value", defaultValue );
47     }
48
49
50     public String JavaDoc getAccessKey() {
51         String JavaDoc accessKey;
52
53         // Make sure that the access key is a single character.
54
accessKey = getAttribute( "accesskey" );
55         if (accessKey != null && accessKey.length() > 1) {
56             accessKey = accessKey.substring( 0, 1 );
57         }
58         return accessKey;
59     }
60
61
62     public void setAccessKey( String JavaDoc accessKey ) {
63         // Make sure that the access key is a single character.
64
if (accessKey != null && accessKey.length() > 1) {
65             accessKey = accessKey.substring( 0, 1 );
66         }
67         setAttribute( "accesskey", accessKey );
68     }
69
70
71     public int getCols() {
72         return toInteger( getAttribute( "cols" ) );
73     }
74
75
76     public void setCols( int cols ) {
77         setAttribute( "cols", String.valueOf( cols ) );
78     }
79
80
81     public boolean getDisabled() {
82         return getAttribute( "disabled" ) != null;
83     }
84
85
86     public void setDisabled( boolean disabled ) {
87         setAttribute( "disabled", disabled ? "" : null );
88     }
89
90
91     public String JavaDoc getName() {
92         return getAttribute( "name" );
93     }
94
95
96     public void setName( String JavaDoc name ) {
97         setAttribute( "name", name );
98     }
99
100
101     public boolean getReadOnly() {
102         return getAttribute( "readonly" ) != null;
103     }
104
105
106     public void setReadOnly( boolean readOnly ) {
107         setAttribute( "readonly", readOnly ? "" : null );
108     }
109
110
111     public int getRows() {
112         return toInteger( getAttribute( "rows" ) );
113     }
114
115
116     public void setRows( int rows ) {
117         setAttribute( "rows", String.valueOf( rows ) );
118     }
119
120
121     public int getTabIndex() {
122         return toInteger( getAttribute( "tabindex" ) );
123     }
124
125
126     public void setTabIndex( int tabIndex ) {
127         setAttribute( "tabindex", String.valueOf( tabIndex ) );
128     }
129
130
131     public String JavaDoc getType() {
132         return getAttribute( "type" );
133     }
134
135
136     public String JavaDoc getValue() {
137         return getAttribute( "value" );
138     }
139
140
141     public void setValue( String JavaDoc value ) {
142         setAttribute( "value", value );
143     }
144
145
146     public void blur() {
147     // No scripting in server-side DOM. This method is moot.
148
}
149
150
151     public void focus() {
152     // No scripting in server-side DOM. This method is moot.
153
}
154
155
156     public void select() {
157     // No scripting in server-side DOM. This method is moot.
158
}
159
160
161     /**
162      * Constructor requires owner document.
163      *
164      * @param owner The owner HTML document
165      */

166     public HTMLTextAreaElementImpl( HTMLDocumentImpl owner, String JavaDoc name ) {
167         super( owner, "TEXTAREA" );
168     }
169
170
171 }
172
Popular Tags