001: /*
002: * The Apache Software License, Version 1.1
003: *
004: *
005: * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
006: * reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * 1. Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * 2. Redistributions in binary form must reproduce the above copyright
016: * notice, this list of conditions and the following disclaimer in
017: * the documentation and/or other materials provided with the
018: * distribution.
019: *
020: * 3. The end-user documentation included with the redistribution,
021: * if any, must include the following acknowledgment:
022: * "This product includes software developed by the
023: * Apache Software Foundation (http://www.apache.org/)."
024: * Alternately, this acknowledgment may appear in the software itself,
025: * if and wherever such third-party acknowledgments normally appear.
026: *
027: * 4. The names "Xerces" and "Apache Software Foundation" must
028: * not be used to endorse or promote products derived from this
029: * software without prior written permission. For written
030: * permission, please contact apache@apache.org.
031: *
032: * 5. Products derived from this software may not be called "Apache",
033: * nor may "Apache" appear in their name, without prior written
034: * permission of the Apache Software Foundation.
035: *
036: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
040: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047: * SUCH DAMAGE.
048: * ====================================================================
049: *
050: * This software consists of voluntary contributions made by many
051: * individuals on behalf of the Apache Software Foundation and was
052: * originally based on software copyright (c) 1999, International
053: * Business Machines, Inc., http://www.apache.org. For more
054: * information on the Apache Software Foundation, please see
055: * <http://www.apache.org/>.
056: */
057: package org.apache.html.dom;
058:
059: import org.w3c.dom.*;
060: import org.w3c.dom.html.*;
061:
062: /**
063: * @version $Revision: 1.4 $ $Date: 2001/01/30 23:58:06 $
064: * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
065: * @see org.w3c.dom.html.HTMLTextAreaElement
066: * @see ElementImpl
067: */
068: public class HTMLTextAreaElementImpl extends HTMLElementImpl implements
069: HTMLTextAreaElement, HTMLFormControl {
070:
071: public String getDefaultValue() {
072: // ! NOT FULLY IMPLEMENTED !
073: return getAttribute("default-value");
074: }
075:
076: public void setDefaultValue(String defaultValue) {
077: // ! NOT FULLY IMPLEMENTED !
078: setAttribute("default-value", defaultValue);
079: }
080:
081: public String getAccessKey() {
082: String accessKey;
083:
084: // Make sure that the access key is a single character.
085: accessKey = getAttribute("accesskey");
086: if (accessKey != null && accessKey.length() > 1)
087: accessKey = accessKey.substring(0, 1);
088: return accessKey;
089: }
090:
091: public void setAccessKey(String accessKey) {
092: // Make sure that the access key is a single character.
093: if (accessKey != null && accessKey.length() > 1)
094: accessKey = accessKey.substring(0, 1);
095: setAttribute("accesskey", accessKey);
096: }
097:
098: public int getCols() {
099: return getInteger(getAttribute("cols"));
100: }
101:
102: public void setCols(int cols) {
103: setAttribute("cols", String.valueOf(cols));
104: }
105:
106: public boolean getDisabled() {
107: return getBinary("disabled");
108: }
109:
110: public void setDisabled(boolean disabled) {
111: setAttribute("disabled", disabled);
112: }
113:
114: public String getName() {
115: return getAttribute("name");
116: }
117:
118: public void setName(String name) {
119: setAttribute("name", name);
120: }
121:
122: public boolean getReadOnly() {
123: return getBinary("readonly");
124: }
125:
126: public void setReadOnly(boolean readOnly) {
127: setAttribute("readonly", readOnly);
128: }
129:
130: public int getRows() {
131: return getInteger(getAttribute("rows"));
132: }
133:
134: public void setRows(int rows) {
135: setAttribute("rows", String.valueOf(rows));
136: }
137:
138: public int getTabIndex() {
139: return getInteger(getAttribute("tabindex"));
140: }
141:
142: public void setTabIndex(int tabIndex) {
143: setAttribute("tabindex", String.valueOf(tabIndex));
144: }
145:
146: public String getType() {
147: return getAttribute("type");
148: }
149:
150: public String getValue() {
151: return getAttribute("value");
152: }
153:
154: public void setValue(String value) {
155: setAttribute("value", value);
156: }
157:
158: public void blur() {
159: // No scripting in server-side DOM. This method is moot.
160: }
161:
162: public void focus() {
163: // No scripting in server-side DOM. This method is moot.
164: }
165:
166: public void select() {
167: // No scripting in server-side DOM. This method is moot.
168: }
169:
170: /**
171: * Constructor requires owner document.
172: *
173: * @param owner The owner HTML document
174: */
175: public HTMLTextAreaElementImpl(HTMLDocumentImpl owner, String name) {
176: super(owner, name);
177: }
178:
179: }
|