KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > xhtml > thead


1 /*
2  * ====================================================================
3  *
4  * The Apache Software License, Version 1.1
5  *
6  * Copyright (c) 1999-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 package org.apache.ecs.xhtml;
59
60 import org.apache.ecs.*;
61
62 /**
63     This class creates a &lt;thead&gt; object.
64     @version $Id: thead.java,v 1.2 2003/04/27 09:36:17 rdonkin Exp $
65     @author <a HREF="mailto:snagy@servletapi.com">Stephan Nagy</a>
66     @author <a HREF="mailto:jon@clearink.com">Jon S. Stevens</a>
67     @author <a HREF="mailto:bojan@binarix.com">Bojan Smojver</a>
68 */

69 public class thead extends MultiPartElement implements Printable, MouseEvents, KeyEvents
70 {
71     /**
72         private initializer.
73     */

74     {
75         setElementType("thead");
76         setCase(LOWERCASE);
77         setAttributeQuote(true);
78     }
79     public thead()
80     {
81     }
82
83     /**
84         Sets the span="" attribute.
85         @param span sets the span="" attribute.
86     */

87     public thead setSpan(String JavaDoc span)
88     {
89         addAttribute("span",span);
90         return(this);
91     }
92
93     /**
94         Sets the span="" attribute.
95         @param span sets the span="" attribute.
96     */

97     public thead setSpan(int span)
98     {
99         addAttribute("span",Integer.toString(span));
100         return(this);
101     }
102
103     /**
104         Supplies user agents with a recommended cell width. (Pixel Values)
105         @param width how many pixels to make cell
106     */

107     public thead setWidth(int width)
108     {
109         addAttribute("width",Integer.toString(width));
110         return(this);
111     }
112     
113     /**
114         Supplies user agents with a recommended cell width. (Pixel Values)
115         @param width how many pixels to make cell
116     */

117     public thead setWidth(String JavaDoc width)
118     {
119         addAttribute("width",width);
120         return(this);
121     }
122
123     /**
124         Sets the align="" attribute convience variables are provided in the AlignType interface
125         @param align Sets the align="" attribute
126     */

127     public thead setAlign(String JavaDoc align)
128     {
129         addAttribute("align",align);
130         return(this);
131     }
132
133     /**
134         Sets the valign="" attribute convience variables are provided in the AlignType interface
135         @param valign Sets the valign="" attribute
136     */

137     public thead setVAlign(String JavaDoc valign)
138     {
139         addAttribute("valign",valign);
140         return(this);
141     }
142
143     /**
144         Sets the char="" attribute.
145         @param character the character to use for alignment.
146     */

147     public thead setChar(String JavaDoc character)
148     {
149         addAttribute("char",character);
150         return(this);
151     }
152
153     /**
154         Sets the charoff="" attribute.
155         @param char_off when present this attribute specifies the offset
156         of the first occurrence of the alignment character on each line.
157     */

158     public thead setCharOff(int char_off)
159     {
160         addAttribute("charoff",Integer.toString(char_off));
161         return(this);
162     }
163
164     /**
165         Sets the charoff="" attribute.
166         @param char_off When present this attribute specifies the offset
167         of the first occurrence of the alignment character on each line.
168     */

169     public thead setCharOff(String JavaDoc char_off)
170     {
171         addAttribute("charoff",char_off);
172         return(this);
173     }
174     
175     /**
176         Sets the lang="" and xml:lang="" attributes
177         @param lang the lang="" and xml:lang="" attributes
178     */

179     public Element setLang(String JavaDoc lang)
180     {
181         addAttribute("lang",lang);
182         addAttribute("xml:lang",lang);
183         return this;
184     }
185
186     /**
187         Adds an Element to the element.
188         @param hashcode name of element for hash table
189         @param element Adds an Element to the element.
190      */

191     public thead addElement(String JavaDoc hashcode,Element element)
192     {
193         addElementToRegistry(hashcode,element);
194         return(this);
195     }
196
197     /**
198         Adds an Element to the element.
199         @param hashcode name of element for hash table
200         @param element Adds an Element to the element.
201      */

202     public thead addElement(String JavaDoc hashcode,String JavaDoc element)
203     {
204         addElementToRegistry(hashcode,element);
205         return(this);
206     }
207
208     /**
209         Adds an Element to the element.
210         @param element Adds an Element to the element.
211      */

212     public thead addElement(Element element)
213     {
214         addElementToRegistry(element);
215         return(this);
216     }
217
218     /**
219         Adds an Element to the element.
220         @param element Adds an Element to the element.
221      */

222     public thead addElement(String JavaDoc element)
223     {
224         addElementToRegistry(element);
225         return(this);
226     }
227     /**
228         Removes an Element from the element.
229         @param hashcode the name of the element to be removed.
230     */

231     public thead removeElement(String JavaDoc hashcode)
232     {
233         removeElementFromRegistry(hashcode);
234         return(this);
235     }
236
237     /**
238         The onclick event occurs when the pointing device button is clicked
239         over an element. This attribute may be used with most elements.
240         
241         @param The script
242     */

243     public void setOnClick(String JavaDoc script)
244     {
245         addAttribute ( "onclick", script );
246     }
247     /**
248         The ondblclick event occurs when the pointing device button is double
249         clicked over an element. This attribute may be used with most elements.
250
251         @param The script
252     */

253     public void setOnDblClick(String JavaDoc script)
254     {
255         addAttribute ( "ondblclick", script );
256     }
257     /**
258         The onmousedown event occurs when the pointing device button is pressed
259         over an element. This attribute may be used with most elements.
260
261         @param The script
262     */

263     public void setOnMouseDown(String JavaDoc script)
264     {
265         addAttribute ( "onmousedown", script );
266     }
267     /**
268         The onmouseup event occurs when the pointing device button is released
269         over an element. This attribute may be used with most elements.
270
271         @param The script
272     */

273     public void setOnMouseUp(String JavaDoc script)
274     {
275         addAttribute ( "onmouseup", script );
276     }
277     /**
278         The onmouseover event occurs when the pointing device is moved onto an
279         element. This attribute may be used with most elements.
280
281         @param The script
282     */

283     public void setOnMouseOver(String JavaDoc script)
284     {
285         addAttribute ( "onmouseover", script );
286     }
287     /**
288         The onmousemove event occurs when the pointing device is moved while it
289         is over an element. This attribute may be used with most elements.
290
291         @param The script
292     */

293     public void setOnMouseMove(String JavaDoc script)
294     {
295         addAttribute ( "onmousemove", script );
296     }
297     /**
298         The onmouseout event occurs when the pointing device is moved away from
299         an element. This attribute may be used with most elements.
300
301         @param The script
302     */

303     public void setOnMouseOut(String JavaDoc script)
304     {
305         addAttribute ( "onmouseout", script );
306     }
307
308     /**
309         The onkeypress event occurs when a key is pressed and released over an
310         element. This attribute may be used with most elements.
311         
312         @param The script
313     */

314     public void setOnKeyPress(String JavaDoc script)
315     {
316         addAttribute ( "onkeypress", script );
317     }
318
319     /**
320         The onkeydown event occurs when a key is pressed down over an element.
321         This attribute may be used with most elements.
322         
323         @param The script
324     */

325     public void setOnKeyDown(String JavaDoc script)
326     {
327         addAttribute ( "onkeydown", script );
328     }
329
330     /**
331         The onkeyup event occurs when a key is released over an element. This
332         attribute may be used with most elements.
333         
334         @param The script
335     */

336     public void setOnKeyUp(String JavaDoc script)
337     {
338         addAttribute ( "onkeyup", script );
339     }
340 }
341
Popular Tags