001: /**
002: * org/ozone-db/xml/dom/html/HTMLTextAreaElementImpl.java
003: *
004: * The contents of this file are subject to the OpenXML Public
005: * License Version 1.0; you may not use this file except in compliance
006: * with the License. You may obtain a copy of the License at
007: * http://www.openxml.org/license.html
008: *
009: * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
010: * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
011: * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
012: * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
013: * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
014: * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
015: *
016: * The Initial Developer of this code under the License is Assaf Arkin.
017: * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
018: * All Rights Reserved.
019: */package org.ozoneDB.xml.dom.html;
020:
021: import org.ozoneDB.xml.dom.*;
022: import org.w3c.dom.*;
023: import org.w3c.dom.html.*;
024:
025: /**
026: * @version $Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
027: * @author <a href="mailto:arkin@trendline.co.il">Assaf Arkin</a>
028: * @see org.w3c.dom.html.HTMLTextAreaElement
029: * @see ElementImpl
030: */
031: public final class HTMLTextAreaElementImpl extends HTMLElementImpl
032: implements HTMLTextAreaElement, HTMLFormControl {
033:
034: public String getDefaultValue() {
035: // ! NOT FULLY IMPLEMENTED !
036: return getAttribute("default-value");
037: }
038:
039: public void setDefaultValue(String defaultValue) {
040: // ! NOT FULLY IMPLEMENTED !
041: setAttribute("default-value", defaultValue);
042: }
043:
044: public String getAccessKey() {
045: String accessKey;
046:
047: // Make sure that the access key is a single character.
048: accessKey = getAttribute("accesskey");
049: if (accessKey != null && accessKey.length() > 1) {
050: accessKey = accessKey.substring(0, 1);
051: }
052: return accessKey;
053: }
054:
055: public void setAccessKey(String accessKey) {
056: // Make sure that the access key is a single character.
057: if (accessKey != null && accessKey.length() > 1) {
058: accessKey = accessKey.substring(0, 1);
059: }
060: setAttribute("accesskey", accessKey);
061: }
062:
063: public int getCols() {
064: return toInteger(getAttribute("cols"));
065: }
066:
067: public void setCols(int cols) {
068: setAttribute("cols", String.valueOf(cols));
069: }
070:
071: public boolean getDisabled() {
072: return getAttribute("disabled") != null;
073: }
074:
075: public void setDisabled(boolean disabled) {
076: setAttribute("disabled", disabled ? "" : null);
077: }
078:
079: public String getName() {
080: return getAttribute("name");
081: }
082:
083: public void setName(String name) {
084: setAttribute("name", name);
085: }
086:
087: public boolean getReadOnly() {
088: return getAttribute("readonly") != null;
089: }
090:
091: public void setReadOnly(boolean readOnly) {
092: setAttribute("readonly", readOnly ? "" : null);
093: }
094:
095: public int getRows() {
096: return toInteger(getAttribute("rows"));
097: }
098:
099: public void setRows(int rows) {
100: setAttribute("rows", String.valueOf(rows));
101: }
102:
103: public int getTabIndex() {
104: return toInteger(getAttribute("tabindex"));
105: }
106:
107: public void setTabIndex(int tabIndex) {
108: setAttribute("tabindex", String.valueOf(tabIndex));
109: }
110:
111: public String getType() {
112: return getAttribute("type");
113: }
114:
115: public String getValue() {
116: return getAttribute("value");
117: }
118:
119: public void setValue(String value) {
120: setAttribute("value", value);
121: }
122:
123: public void blur() {
124: // No scripting in server-side DOM. This method is moot.
125: }
126:
127: public void focus() {
128: // No scripting in server-side DOM. This method is moot.
129: }
130:
131: public void select() {
132: // No scripting in server-side DOM. This method is moot.
133: }
134:
135: /**
136: * Constructor requires owner document.
137: *
138: * @param owner The owner HTML document
139: */
140: public HTMLTextAreaElementImpl(HTMLDocumentImpl owner, String name) {
141: super (owner, "TEXTAREA");
142: }
143:
144: }
|