001: /**
002: * org/ozone-db/xml/dom/html/HTMLAreaElementImpl.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.HTMLAreaElement
029: * @see ElementImpl
030: */
031: public final class HTMLAreaElementImpl extends HTMLElementImpl
032: implements HTMLAreaElement {
033:
034: public String getAccessKey() {
035: String accessKey;
036:
037: // Make sure that the access key is a single character.
038: accessKey = getAttribute("accesskey");
039: if (accessKey != null && accessKey.length() > 1) {
040: accessKey = accessKey.substring(0, 1);
041: }
042: return accessKey;
043: }
044:
045: public void setAccessKey(String accessKey) {
046: // Make sure that the access key is a single character.
047: if (accessKey != null && accessKey.length() > 1) {
048: accessKey = accessKey.substring(0, 1);
049: }
050: setAttribute("accesskey", accessKey);
051: }
052:
053: public String getAlt() {
054: return getAttribute("alt");
055: }
056:
057: public void setAlt(String alt) {
058: setAttribute("alt", alt);
059: }
060:
061: public String getCoords() {
062: return getAttribute("coords");
063: }
064:
065: public void setCoords(String coords) {
066: setAttribute("coords", coords);
067: }
068:
069: public String getHref() {
070: return getAttribute("href");
071: }
072:
073: public void setHref(String href) {
074: setAttribute("href", href);
075: }
076:
077: public boolean getNoHref() {
078: return getAttribute("href") != null;
079: }
080:
081: public void setNoHref(boolean noHref) {
082: setAttribute("nohref", noHref ? "" : null);
083: }
084:
085: public String getShape() {
086: return capitalize(getAttribute("shape"));
087: }
088:
089: public void setShape(String shape) {
090: setAttribute("shape", shape);
091: }
092:
093: public int getTabIndex() {
094: return toInteger(getAttribute("tabindex"));
095: }
096:
097: public void setTabIndex(int tabIndex) {
098: setAttribute("tabindex", String.valueOf(tabIndex));
099: }
100:
101: public String getTarget() {
102: return getAttribute("target");
103: }
104:
105: public void setTarget(String target) {
106: setAttribute("target", target);
107: }
108:
109: /**
110: * Constructor requires owner document.
111: *
112: * @param owner The owner HTML document
113: */
114: public HTMLAreaElementImpl(HTMLDocumentImpl owner, String name) {
115: super (owner, "AREA");
116: }
117:
118: }
|