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