001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.html.dom;
018:
019: import org.w3c.dom.html.HTMLTextAreaElement;
020:
021: /**
022: * @xerces.internal
023: * @version $Revision: 447255 $ $Date: 2006-09-18 01:36:42 -0400 (Mon, 18 Sep 2006) $
024: * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
025: * @see org.w3c.dom.html.HTMLTextAreaElement
026: * @see org.apache.xerces.dom.ElementImpl
027: */
028: public class HTMLTextAreaElementImpl extends HTMLElementImpl implements
029: HTMLTextAreaElement, HTMLFormControl {
030:
031: private static final long serialVersionUID = -6737778308542678104L;
032:
033: public String getDefaultValue() {
034: // ! NOT FULLY IMPLEMENTED !
035: return getAttribute("default-value");
036: }
037:
038: public void setDefaultValue(String defaultValue) {
039: // ! NOT FULLY IMPLEMENTED !
040: setAttribute("default-value", defaultValue);
041: }
042:
043: public String getAccessKey() {
044: String accessKey;
045:
046: // Make sure that the access key is a single character.
047: accessKey = getAttribute("accesskey");
048: if (accessKey != null && accessKey.length() > 1)
049: accessKey = accessKey.substring(0, 1);
050: return accessKey;
051: }
052:
053: public void setAccessKey(String accessKey) {
054: // Make sure that the access key is a single character.
055: if (accessKey != null && accessKey.length() > 1)
056: accessKey = accessKey.substring(0, 1);
057: setAttribute("accesskey", accessKey);
058: }
059:
060: public int getCols() {
061: return getInteger(getAttribute("cols"));
062: }
063:
064: public void setCols(int cols) {
065: setAttribute("cols", String.valueOf(cols));
066: }
067:
068: public boolean getDisabled() {
069: return getBinary("disabled");
070: }
071:
072: public void setDisabled(boolean disabled) {
073: setAttribute("disabled", disabled);
074: }
075:
076: public String getName() {
077: return getAttribute("name");
078: }
079:
080: public void setName(String name) {
081: setAttribute("name", name);
082: }
083:
084: public boolean getReadOnly() {
085: return getBinary("readonly");
086: }
087:
088: public void setReadOnly(boolean readOnly) {
089: setAttribute("readonly", readOnly);
090: }
091:
092: public int getRows() {
093: return getInteger(getAttribute("rows"));
094: }
095:
096: public void setRows(int rows) {
097: setAttribute("rows", String.valueOf(rows));
098: }
099:
100: public int getTabIndex() {
101: return getInteger(getAttribute("tabindex"));
102: }
103:
104: public void setTabIndex(int tabIndex) {
105: setAttribute("tabindex", String.valueOf(tabIndex));
106: }
107:
108: public String getType() {
109: return getAttribute("type");
110: }
111:
112: public String getValue() {
113: return getAttribute("value");
114: }
115:
116: public void setValue(String value) {
117: setAttribute("value", value);
118: }
119:
120: public void blur() {
121: // No scripting in server-side DOM. This method is moot.
122: }
123:
124: public void focus() {
125: // No scripting in server-side DOM. This method is moot.
126: }
127:
128: public void select() {
129: // No scripting in server-side DOM. This method is moot.
130: }
131:
132: /**
133: * Constructor requires owner document.
134: *
135: * @param owner The owner HTML document
136: */
137: public HTMLTextAreaElementImpl(HTMLDocumentImpl owner, String name) {
138: super(owner, name);
139: }
140:
141: }
|