KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
64     This class creates a &lt;TT&gt; tag.
65
66     @version $Id: TT.java,v 1.4 2003/04/27 09:03:39 rdonkin Exp $
67     @author <a HREF="mailto:snagy@servletapi.com">Stephan Nagy</a>
68     @author <a HREF="mailto:jon@clearink.com">Jon S. Stevens</a>
69 */

70 public class TT extends MultiPartElement implements Printable, MouseEvents, KeyEvents
71 {
72     /**
73         Private initialization routine.
74     */

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

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

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

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

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

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

129     public TT addElement(Element element)
130     {
131         addElementToRegistry(element);
132         return(this);
133     }
134
135     /**
136         Adds an Element to the element.
137         @param element Adds an Element to the element.
138      */

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

148     public TT removeElement(String JavaDoc hashcode)
149     {
150         removeElementFromRegistry(hashcode);
151         return(this);
152     }
153
154     /**
155         The onclick event occurs when the pointing device button is clicked
156         over an element. This attribute may be used with most elements.
157         
158         @param The script
159     */

160     public void setOnClick(String JavaDoc script)
161     {
162         addAttribute ( "onClick", script );
163     }
164     /**
165         The ondblclick event occurs when the pointing device button is double
166         clicked over an element. This attribute may be used with most elements.
167
168         @param The script
169     */

170     public void setOnDblClick(String JavaDoc script)
171     {
172         addAttribute ( "onDblClick", script );
173     }
174     /**
175         The onmousedown event occurs when the pointing device button is pressed
176         over an element. This attribute may be used with most elements.
177
178         @param The script
179     */

180     public void setOnMouseDown(String JavaDoc script)
181     {
182         addAttribute ( "onMouseDown", script );
183     }
184     /**
185         The onmouseup event occurs when the pointing device button is released
186         over an element. This attribute may be used with most elements.
187
188         @param The script
189     */

190     public void setOnMouseUp(String JavaDoc script)
191     {
192         addAttribute ( "onMouseUp", script );
193     }
194     /**
195         The onmouseover event occurs when the pointing device is moved onto an
196         element. This attribute may be used with most elements.
197
198         @param The script
199     */

200     public void setOnMouseOver(String JavaDoc script)
201     {
202         addAttribute ( "onMouseOver", script );
203     }
204     /**
205         The onmousemove event occurs when the pointing device is moved while it
206         is over an element. This attribute may be used with most elements.
207
208         @param The script
209     */

210     public void setOnMouseMove(String JavaDoc script)
211     {
212         addAttribute ( "onMouseMove", script );
213     }
214     /**
215         The onmouseout event occurs when the pointing device is moved away from
216         an element. This attribute may be used with most elements.
217
218         @param The script
219     */

220     public void setOnMouseOut(String JavaDoc script)
221     {
222         addAttribute ( "onMouseOut", script );
223     }
224
225     /**
226         The onkeypress event occurs when a key is pressed and released over an
227         element. This attribute may be used with most elements.
228         
229         @param The script
230     */

231     public void setOnKeyPress(String JavaDoc script)
232     {
233         addAttribute ( "onKeyPress", script );
234     }
235
236     /**
237         The onkeydown event occurs when a key is pressed down over an element.
238         This attribute may be used with most elements.
239         
240         @param The script
241     */

242     public void setOnKeyDown(String JavaDoc script)
243     {
244         addAttribute ( "onKeyDown", script );
245     }
246
247     /**
248         The onkeyup event occurs when a key is released over an element. This
249         attribute may be used with most elements.
250         
251         @param The script
252     */

253     public void setOnKeyUp(String JavaDoc script)
254     {
255         addAttribute ( "onKeyUp", script );
256     }
257 }
258
Popular Tags