KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > wml > Optgroup


1 /*
2  * ====================================================================
3  *
4  * The Apache Software License, Version 1.1
5  *
6  * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
7  * reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if
22  * any, must include the following acknowlegement:
23  * "This product includes software developed by the
24  * Apache Software Foundation (http://www.apache.org/)."
25  * Alternately, this acknowlegement may appear in the software itself,
26  * if and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The names "The Jakarta Project", "Jakarta Element Construction Set",
29  * "Jakarta ECS" , and "Apache Software Foundation" must not be used
30  * to endorse or promote products derived
31  * from this software without prior written permission. For written
32  * permission, please contact apache@apache.org.
33  *
34  * 5. Products derived from this software may not be called "Apache",
35  * "Jakarta Element Construction Set" nor "Jakarta ECS" nor may "Apache"
36  * appear in their names without prior written permission of the Apache Group.
37  *
38  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49  * SUCH DAMAGE.
50  * ====================================================================
51  *
52  * This software consists of voluntary contributions made by many
53  * individuals on behalf of the Apache Software Foundation. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  *
57  */

58
59 package org.apache.ecs.wml;
60
61 import org.apache.ecs.*;
62
63 /**
64  * This represents a &lt;optgroup&gt; element.
65  */

66 public class Optgroup extends org.apache.ecs.MultiPartElement implements org.apache.ecs.Printable
67 {
68    /**
69         Private initialization routine.
70     */

71     {
72         setElementType("optgroup");
73     }
74
75     /**
76         Basic constructor. You need to set the attributes using the
77         set* methods.
78     */

79     public Optgroup()
80     {
81     }
82
83     /**
84         Use the set* methods to set the values
85         of the attributes.
86
87         @param element set the value of &lt;H1&gt;value&lt;/H1&gt;
88     */

89     public Optgroup(org.apache.ecs.Element element)
90     {
91         addElement(element);
92     }
93
94     /**
95         Use the set* methods to set the values
96         of the attributes.
97
98         @param value set the value of &lt;H1&gt;value&lt;/H1&gt;
99     */

100     public Optgroup(String JavaDoc value)
101     {
102         addElement(value);
103     }
104
105     /**
106         Adds an Element to the element.
107         @param hashcode name of element for hash table
108         @param element Adds an Element to the element.
109      */

110     public Optgroup addElement(String JavaDoc hashcode,org.apache.ecs.Element element)
111     {
112         addElementToRegistry(hashcode,element);
113         return(this);
114     }
115
116     /**
117         Adds an Element to the element.
118         @param hashcode name of element for hash table
119         @param element Adds an Element to the element.
120      */

121     public Optgroup addElement(String JavaDoc hashcode,String JavaDoc element)
122     {
123         addElementToRegistry(hashcode,element);
124         return(this);
125     }
126
127     /**
128         Adds an Element to the element.
129         @param element Adds an Element to the element.
130      */

131     public Optgroup addElement(org.apache.ecs.Element element)
132     {
133         addElementToRegistry(element);
134         return(this);
135     }
136     /**
137         Adds an Element to the element.
138         @param element Adds an Element to the element.
139      */

140     public Optgroup addElement(String JavaDoc element)
141     {
142         addElementToRegistry(element);
143         return(this);
144     }
145     /**
146         Removes an Element from the element.
147         @param hashcode the name of the element to be removed.
148     */

149     public Optgroup removeElement(String JavaDoc hashcode)
150     {
151         removeElementFromRegistry(hashcode);
152         return(this);
153     }
154
155 //------------------------Attributes
156
/**
157      * Get the TitleAttr attribute.
158      */

159     public String JavaDoc getTitleAttr()
160     {
161         return getAttribute("title");
162     }
163   
164     /**
165      * Set the TitleAttr attribute.
166      */

167     public Optgroup setTitleAttr(String JavaDoc value)
168     {
169         addAttribute("title",value);
170         return this;
171     }
172                     /**
173      * Get the Xml_lang attribute.
174      */

175     public String JavaDoc getXml_lang()
176     {
177         return getAttribute("xml:lang");
178     }
179   
180     /**
181      * Set the Xml_lang attribute.
182      */

183     public Optgroup setXml_lang(String JavaDoc value)
184     {
185         addAttribute("xml:lang",value);
186         return this;
187     }
188                     /**
189      * Get the Id attribute.
190      */

191     public String JavaDoc getId()
192     {
193         return getAttribute("id");
194     }
195   
196     /**
197      * Set the Id attribute.
198      */

199     public Optgroup setId(String JavaDoc value)
200     {
201         addAttribute("id",value);
202         return this;
203     }
204                     /**
205      * Get the Classname attribute.
206      */

207     public String JavaDoc getClassname()
208     {
209         return getAttribute("class");
210     }
211   
212     /**
213      * Set the Classname attribute.
214      */

215     public Optgroup setClassname(String JavaDoc value)
216     {
217         addAttribute("class",value);
218         return this;
219     }
220 }
221
Popular Tags