KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > faces > taglib > StylesheetTag


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.struts.faces.taglib;
18
19
20 import javax.faces.component.UIComponent;
21
22
23 /**
24  * <p>Render a stylesheet HTML <code>&lt;link&gt;</code> element for
25  * the <em>Struts-Faces Integration Library</em>.</p>
26  *
27  *
28  * @version $Rev: 54934 $ $Date: 2004-10-16 18:07:50 +0100 (Sat, 16 Oct 2004) $
29  */

30
31 public class StylesheetTag extends AbstractFacesTag {
32
33
34     // ---------------------------------------------------------- Tag Attributes
35

36
37     /**
38      * <p>The context-relative path for this link.</p>
39      */

40     private String JavaDoc path = null;
41
42     public void setPath(String JavaDoc path) {
43         this.path = path;
44     }
45
46
47
48     // ---------------------------------------------------------- Public Methods
49

50
51     /**
52      * <p>Return the type of component to be created for this tag.</p>
53      */

54     public String JavaDoc getComponentType() {
55
56         return ("org.apache.struts.faces.Stylesheet");
57
58     }
59
60
61     /**
62      * <p>Return the <code>rendererType</code> to be used for rendering
63      * our component.</p>
64      */

65     public String JavaDoc getRendererType() {
66
67         return ("org.apache.struts.faces.Stylesheet");
68
69     }
70
71
72     /**
73      * <p>Release resources allocated to this tag instance.</p>
74      */

75     public void release() {
76
77         super.release();
78         this.path = null;
79
80     }
81
82
83     // ------------------------------------------------------- Protected Methods
84

85
86     /**
87      * <p>Override attributes set on this tag instance.</p>
88      *
89      * @param component Component whose attributes should be overridden
90      */

91     protected void setProperties(UIComponent component) {
92
93         super.setProperties(component);
94         setStringAttribute(component, "path", path);
95
96     }
97
98
99 }
100
Popular Tags