001: /**
002: * org/ozone-db/xml/dom/html/HTMLFormElementImpl.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.HTMLFormElement
029: * @see ElementImpl
030: */
031: public final class HTMLFormElementImpl extends HTMLElementImpl
032: implements HTMLFormElement {
033:
034: public HTMLCollection getElements() {
035: if (_elements == null) {
036: _elements = new HTMLCollectionImpl(this ,
037: HTMLCollectionImpl.ELEMENT);
038: }
039: return _elements;
040: }
041:
042: public int getLength() {
043: return getElements().getLength();
044: }
045:
046: public String getName() {
047: return getAttribute("name");
048: }
049:
050: public void setName(String name) {
051: setAttribute("name", name);
052: }
053:
054: public String getAcceptCharset() {
055: return getAttribute("accept-charset");
056: }
057:
058: public void setAcceptCharset(String acceptCharset) {
059: setAttribute("accept-charset", acceptCharset);
060: }
061:
062: public String getAction() {
063: return getAttribute("action");
064: }
065:
066: public void setAction(String action) {
067: setAttribute("action", action);
068: }
069:
070: public String getEnctype() {
071: return getAttribute("enctype");
072: }
073:
074: public void setEnctype(String enctype) {
075: setAttribute("enctype", enctype);
076: }
077:
078: public String getMethod() {
079: return capitalize(getAttribute("method"));
080: }
081:
082: public void setMethod(String method) {
083: setAttribute("method", method);
084: }
085:
086: public String getTarget() {
087: return getAttribute("target");
088: }
089:
090: public void setTarget(String target) {
091: setAttribute("target", target);
092: }
093:
094: public void submit() {
095: // No scripting in server-side DOM. This method is moot.
096: }
097:
098: public void reset() {
099: // No scripting in server-side DOM. This method is moot.
100: }
101:
102: /**
103: * Constructor requires owner document.
104: *
105: * @param owner The owner HTML document
106: */
107: public HTMLFormElementImpl(HTMLDocumentImpl owner, String name) {
108: super (owner, "FORM");
109: }
110:
111: /**
112: * Collection of all elements contained in this FORM.
113: */
114: private HTMLCollectionImpl _elements;
115:
116: }
|