KickJava   Java API By Example, From Geeks To Geeks.

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


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;COL&gt; object.
64
65     @version $Id: Col.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 Col extends SinglePartElement implements Printable
70 {
71     /**
72         private initializer.
73     */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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