KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ecs > html > ColGroup


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.html;
59
60 import org.apache.ecs.*;
61
62 /**
63     This class creates a &lt;COLGROUP&gt; object.
64
65     @version $Id: ColGroup.java,v 1.3 2003/04/27 09:21:31 rdonkin Exp $
66     @author <a HREF="mailto:snagy@servletapi.com">Stephan Nagy</a>
67     @author <a HREF="mailto:jon@clearink.com">Jon S. Stevens</a>
68 */

69 public class ColGroup extends MultiPartElement implements Printable
70 {
71     /**
72         private initializer.
73     */

74     {
75         setElementType("colgroup");
76         setNeedClosingTag(false);
77     }
78     public ColGroup()
79     {
80     }
81
82     /**
83         Sets the SPAN="" attribute.
84         @param span sets the SPAN="" attribute.
85     */

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

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

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

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

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

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

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

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

168     public ColGroup setCharOff(String JavaDoc char_off)
169     {
170         addAttribute("charoff",char_off);
171         return(this);
172     }
173     
174     /**
175         Adds an Element to the element.
176         @param hashcode name of element for hash table
177         @param element Adds an Element to the element.
178      */

179     public ColGroup addElement(String JavaDoc hashcode,Element element)
180     {
181         addElementToRegistry(hashcode,element);
182         return(this);
183     }
184
185     /**
186         Adds an Element to the element.
187         @param hashcode name of element for hash table
188         @param element Adds an Element to the element.
189      */

190     public ColGroup addElement(String JavaDoc hashcode,String JavaDoc element)
191     {
192         addElementToRegistry(hashcode,element);
193         return(this);
194     }
195     /**
196         Adds an Element to the element.
197         @param element Adds an Element to the element.
198      */

199     public ColGroup addElement(Element element)
200     {
201         addElementToRegistry(element);
202         return(this);
203     }
204
205     /**
206         Adds an Element to the element.
207         @param element Adds an Element to the element.
208      */

209     public ColGroup addElement(String JavaDoc element)
210     {
211         addElementToRegistry(element);
212         return(this);
213     }
214     /**
215         Removes an Element from the element.
216         @param hashcode the name of the element to be removed.
217     */

218     public ColGroup removeElement(String JavaDoc hashcode)
219     {
220         removeElementFromRegistry(hashcode);
221         return(this);
222     }
223 }
224
Popular Tags