KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > ext > HtmlCommandLinkTag


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.taglib.html.ext;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.component.html.ext.HtmlCommandLink;
20 import org.apache.myfaces.taglib.html.HtmlCommandLinkTagBase;
21
22 import javax.faces.component.UIComponent;
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: matzew $)
26  * @version $Revision: 1.8 $ $Date: 2005/02/18 17:19:29 $
27  * $Log: HtmlCommandLinkTag.java,v $
28  * Revision 1.8 2005/02/18 17:19:29 matzew
29  * added release() to tag clazzes.
30  *
31  * Revision 1.7 2004/10/13 11:50:59 matze
32  * renamed packages to org.apache
33  *
34  * Revision 1.6 2004/07/01 21:53:06 mwessendorf
35  * ASF switch
36  *
37  * Revision 1.5 2004/05/18 14:31:38 manolito
38  * user role support completely moved to components source tree
39  *
40  * Revision 1.4 2004/04/29 18:51:20 o_rossmueller
41  * moved 'target' attribute to standard htmlCommandLink
42  *
43  * Revision 1.3 2004/04/05 11:04:55 manolito
44  * setter for renderer type removed, no more default renderer type needed
45  *
46  * Revision 1.2 2004/04/01 12:57:42 manolito
47  * additional extended component classes for user role support
48  *
49  * Revision 1.1 2004/03/31 12:15:28 manolito
50  * custom component refactoring
51  *
52  */

53 public class HtmlCommandLinkTag
54         extends HtmlCommandLinkTagBase
55 {
56     //private static final Log log = LogFactory.getLog(HtmlCommandLinkTag.class);
57

58     public String JavaDoc getComponentType()
59     {
60         return HtmlCommandLink.COMPONENT_TYPE;
61     }
62
63     public String JavaDoc getRendererType()
64     {
65         return "org.apache.myfaces.Link";
66     }
67
68
69     // User Role support
70
private String JavaDoc _enabledOnUserRole;
71     private String JavaDoc _visibleOnUserRole;
72
73     public void release() {
74         super.release();
75
76         _enabledOnUserRole=null;
77         _visibleOnUserRole=null;
78     }
79     
80     protected void setProperties(UIComponent component)
81     {
82         super.setProperties(component);
83         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
84         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
85     }
86
87
88     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
89     {
90         _enabledOnUserRole = enabledOnUserRole;
91     }
92
93     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
94     {
95         _visibleOnUserRole = visibleOnUserRole;
96     }
97 }
98
Popular Tags