KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > xml > dom > html > HTMLFormElementImpl


1 /**
2  * org/ozone-db/xml/dom/html/HTMLFormElementImpl.java
3  *
4  * The contents of this file are subject to the OpenXML Public
5  * License Version 1.0; you may not use this file except in compliance
6  * with the License. You may obtain a copy of the License at
7  * http://www.openxml.org/license.html
8  *
9  * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
10  * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
11  * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
12  * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
13  * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
14  * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
15  *
16  * The Initial Developer of this code under the License is Assaf Arkin.
17  * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
18  * All Rights Reserved.
19  */

20
21
22 package org.ozoneDB.xml.dom.html;
23
24
25 import org.ozoneDB.xml.dom.ElementImpl;
26 import org.w3c.dom.html.HTMLCollection;
27 import org.w3c.dom.html.HTMLFormElement;
28
29
30 /**
31  * @version $Revision: 1.2 $ $Date: 2003/11/20 23:18:42 $
32  * @author <a HREF="mailto:arkin@trendline.co.il">Assaf Arkin</a>
33  * @see org.w3c.dom.html.HTMLFormElement
34  * @see ElementImpl
35  */

36 public final class HTMLFormElementImpl extends HTMLElementImpl implements HTMLFormElement {
37
38
39     public HTMLCollection getElements() {
40         if (_elements == null) {
41             _elements = new HTMLCollectionImpl( this, HTMLCollectionImpl.ELEMENT );
42         }
43         return _elements;
44     }
45
46
47     public int getLength() {
48         return getElements().getLength();
49     }
50
51
52     public String JavaDoc getName() {
53         return getAttribute( "name" );
54     }
55
56
57     public void setName( String JavaDoc name ) {
58         setAttribute( "name", name );
59     }
60
61
62     public String JavaDoc getAcceptCharset() {
63         return getAttribute( "accept-charset" );
64     }
65
66
67     public void setAcceptCharset( String JavaDoc acceptCharset ) {
68         setAttribute( "accept-charset", acceptCharset );
69     }
70
71
72     public String JavaDoc getAction() {
73         return getAttribute( "action" );
74     }
75
76
77     public void setAction( String JavaDoc action ) {
78         setAttribute( "action", action );
79     }
80
81
82     public String JavaDoc getEnctype() {
83         return getAttribute( "enctype" );
84     }
85
86
87     public void setEnctype( String JavaDoc enctype ) {
88         setAttribute( "enctype", enctype );
89     }
90
91
92     public String JavaDoc getMethod() {
93         return capitalize( getAttribute( "method" ) );
94     }
95
96
97     public void setMethod( String JavaDoc method ) {
98         setAttribute( "method", method );
99     }
100
101
102     public String JavaDoc getTarget() {
103         return getAttribute( "target" );
104     }
105
106
107     public void setTarget( String JavaDoc target ) {
108         setAttribute( "target", target );
109     }
110
111
112     public void submit() {
113     // No scripting in server-side DOM. This method is moot.
114
}
115
116
117     public void reset() {
118     // No scripting in server-side DOM. This method is moot.
119
}
120
121
122     /**
123      * Constructor requires owner document.
124      *
125      * @param owner The owner HTML document
126      */

127     public HTMLFormElementImpl( HTMLDocumentImpl owner, String JavaDoc name ) {
128         super( owner, "FORM" );
129     }
130
131
132     /**
133      * Collection of all elements contained in this FORM.
134      */

135     private HTMLCollectionImpl _elements;
136
137 }
138
Popular Tags