KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > rssticker > HtmlRssTickerTag


1 /*
2  * Copyright 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 package org.apache.myfaces.custom.rssticker;
17
18 import javax.faces.component.UIComponent;
19
20 import org.apache.myfaces.component.UserRoleAware;
21 import org.apache.myfaces.taglib.html.HtmlOutputTextTagBase;
22
23 /**
24  * @author mwessendorf (latest modification by $Author: matzew $)
25  * @version $Revision: 1.6 $ $Date: 2005/02/22 13:41:10 $
26  * $Log: HtmlRssTickerTag.java,v $
27  * Revision 1.6 2005/02/22 13:41:10 matzew
28  * added RENDER_TYPE constant
29  *
30  * Revision 1.5 2005/02/18 17:19:31 matzew
31  * added release() to tag clazzes.
32  *
33  * Revision 1.4 2004/10/13 11:50:57 matze
34  * renamed packages to org.apache
35  *
36  * Revision 1.3 2004/07/01 21:53:10 mwessendorf
37  * ASF switch
38  *
39  * Revision 1.2 2004/06/27 22:06:26 mwessendorf
40  * Log
41  *
42  *
43  */

44 public class HtmlRssTickerTag extends HtmlOutputTextTagBase{
45
46     public String JavaDoc getComponentType()
47     {
48         return HtmlRssTicker.COMPONENT_TYPE;
49     }
50
51     public String JavaDoc getRendererType()
52     {
53         return HtmlRssTickerRenderer.RENDERER_TYPE;
54     }
55
56     //Ticker attribute
57
private String JavaDoc _rssUrl = null;
58
59     // User Role support
60
private String JavaDoc _enabledOnUserRole;
61     private String JavaDoc _visibleOnUserRole;
62     
63     public void release() {
64         super.release();
65
66         _rssUrl=null;
67         _enabledOnUserRole=null;
68         _visibleOnUserRole=null;
69
70     }
71     
72     /**
73      * overrides setProperties() form UIComponentTag.
74      */

75     protected void setProperties(UIComponent component)
76     {
77         super.setProperties(component);
78
79         setStringProperty(component, "rssUrl", _rssUrl);
80         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
81         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
82     }
83     
84
85    //---------------------------------------------only the Setters
86

87     public void setRssUrl(String JavaDoc string) {
88         _rssUrl = string;
89     }
90
91     public void setEnabledOnUserRole(String JavaDoc string) {
92         _enabledOnUserRole = string;
93     }
94
95     public void setVisibleOnUserRole(String JavaDoc string) {
96         _visibleOnUserRole = string;
97     }
98 }
99
Popular Tags