KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > renderkit > html > ext > HtmlLinkRenderer


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.renderkit.html.ext;
17
18 import org.apache.myfaces.component.UserRoleUtils;
19 import org.apache.myfaces.renderkit.html.HtmlLinkRendererBase;
20
21 import javax.faces.component.UIComponent;
22 import javax.faces.component.UIOutput;
23 import javax.faces.context.FacesContext;
24 import java.io.IOException JavaDoc;
25
26 /**
27  * @author Manfred Geiler (latest modification by $Author: matze $)
28  * @version $Revision: 1.4 $ $Date: 2004/10/13 11:50:59 $
29  * $Log: HtmlLinkRenderer.java,v $
30  * Revision 1.4 2004/10/13 11:50:59 matze
31  * renamed packages to org.apache
32  *
33  * Revision 1.3 2004/07/01 21:53:06 mwessendorf
34  * ASF switch
35  *
36  * Revision 1.2 2004/06/08 02:05:14 o_rossmueller
37  * as for JSF 1.1 value is rendered as link text by standard link renderer
38  *
39  * Revision 1.1 2004/05/18 14:31:38 manolito
40  * user role support completely moved to components source tree
41  *
42  */

43 public class HtmlLinkRenderer
44         extends HtmlLinkRendererBase
45 {
46     //private static final Log log = LogFactory.getLog(HtmlLinkRenderer.class);
47

48     protected void renderCommandLinkStart(FacesContext facesContext,
49                                           UIComponent component,
50                                           String JavaDoc clientId,
51                                           Object JavaDoc value,
52                                           String JavaDoc style,
53                                           String JavaDoc styleClass) throws IOException JavaDoc
54     {
55         //if link is disabled we render the nested components without the anchor
56
if (UserRoleUtils.isEnabledOnUserRole(component))
57         {
58             super.renderCommandLinkStart(facesContext, component, clientId, value, style, styleClass);
59         }
60     }
61
62     protected void renderOutputLinkStart(FacesContext facesContext, UIOutput output) throws IOException JavaDoc
63     {
64         //if link is disabled we render the nested components without the anchor
65
if (UserRoleUtils.isEnabledOnUserRole(output))
66         {
67             super.renderOutputLinkStart(facesContext, output);
68         }
69     }
70
71     protected void renderLinkEnd(FacesContext facesContext, UIComponent component) throws IOException JavaDoc
72     {
73         //if link is disabled we render the nested components without the anchor
74
if (UserRoleUtils.isEnabledOnUserRole(component))
75         {
76             super.renderLinkEnd(facesContext, component);
77         }
78     }
79
80 }
81
Popular Tags