KickJava   Java API By Example, From Geeks To Geeks.

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


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;FrameSet&gt; tag.
64
65     @version $Id: FrameSet.java,v 1.4 2003/04/27 09:21:50 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 FrameSet extends MultiPartElement implements Printable, PageEvents
70 {
71     /**
72         Private initialization routine.
73     */

74     {
75         setElementType("frameset");
76     }
77     
78     /**
79         Basic constructor.
80     */

81     public FrameSet()
82     {
83     }
84
85     /**
86         Basic constructor.
87         @param element Adds an Element to the element.
88     */

89     public FrameSet(Element element)
90     {
91         addElement(element);
92     }
93
94     /**
95         Basic constructor.
96         @param element Adds an Element to the element.
97     */

98     public FrameSet(String JavaDoc element)
99     {
100         addElement(element);
101     }
102
103     /**
104         Basic constructor.
105         @param rows Sets the ROWS="" attribute
106         @param cols Sets the COLS="" attribute
107     */

108     public FrameSet(String JavaDoc rows, String JavaDoc cols)
109     {
110         setRows(rows);
111         setCols(cols);
112     }
113
114     /**
115         Basic constructor.
116         @param rows Sets the ROWS="" attribute
117         @param cols Sets the COLS="" attribute
118         @param element Adds an Element to the element.
119     */

120     public FrameSet(String JavaDoc rows, String JavaDoc cols, Element element)
121     {
122         addElement(element);
123         setRows(rows);
124         setCols(cols);
125     }
126
127     /**
128         Basic constructor.
129         @param rows Sets the ROWS="" attribute
130         @param cols Sets the COLS="" attribute
131         @param element Adds an Element to the element.
132     */

133     public FrameSet(String JavaDoc rows, String JavaDoc cols, String JavaDoc element)
134     {
135         addElement(element);
136         setRows(rows);
137         setCols(cols);
138     }
139
140     /**
141         Sets the ROWS="" attribute
142         @param rows Sets the ROWS="" attribute
143     */

144     public FrameSet setRows(int rows)
145     {
146         setRows(Integer.toString(rows));
147         return(this);
148     }
149
150     /**
151         Sets the ROWS="" attribute
152         @param rows Sets the ROWS="" attribute
153     */

154     public FrameSet setRows(String JavaDoc rows)
155     {
156         addAttribute("rows",rows);
157         return(this);
158     }
159
160     /**
161         Sets the COLS="" attribute
162         @param cols Sets the COLS="" attribute
163     */

164     public FrameSet setCols(int cols)
165     {
166         setCols(Integer.toString(cols));
167         return(this);
168     }
169
170     /**
171         Sets the COLS="" attribute
172         @param cols Sets the COLS="" attribute
173     */

174     public FrameSet setCols(String JavaDoc cols)
175     {
176         addAttribute("cols",cols);
177         return(this);
178     }
179
180     /**
181         Adds an Element to the element.
182         @param hashcode name of element for hash table
183         @param element Adds an Element to the element.
184      */

185     public FrameSet addElement(String JavaDoc hashcode,Element element)
186     {
187         addElementToRegistry(hashcode,element);
188         return(this);
189     }
190
191     /**
192         Adds an Element to the element.
193         @param hashcode name of element for hash table
194         @param element Adds an Element to the element.
195      */

196     public FrameSet addElement(String JavaDoc hashcode,String JavaDoc element)
197     {
198         addElementToRegistry(hashcode,element);
199         return(this);
200     }
201     /**
202         Adds an Element to the element.
203         @param element Adds an Element to the element.
204      */

205     public FrameSet addElement(Element element)
206     {
207         addElementToRegistry(element);
208         return(this);
209     }
210
211     /**
212         Adds an Element to the element.
213         @param element Adds an Element to the element.
214      */

215     public FrameSet addElement(String JavaDoc element)
216     {
217         addElementToRegistry(element);
218         return(this);
219     }
220     /**
221         Removes an Element from the element.
222         @param hashcode the name of the element to be removed.
223     */

224     public FrameSet removeElement(String JavaDoc hashcode)
225     {
226         removeElementFromRegistry(hashcode);
227         return(this);
228     }
229
230     /**
231         The onload event occurs when the user agent finishes loading a window
232         or all frames within a FRAMESET. This attribute may be used with BODY
233         and FRAMESET elements.
234         
235         @param The script
236     */

237     public void setOnLoad(String JavaDoc script)
238     {
239         addAttribute ( "onLoad", script );
240     }
241
242     /**
243         The onunload event occurs when the user agent removes a document from a
244         window or frame. This attribute may be used with BODY and FRAMESET
245         elements.
246         
247         @param The script
248     */

249     public void setOnUnload(String JavaDoc script)
250     {
251         addAttribute ( "onUnload", script );
252     }
253 }
254
Popular Tags