KickJava   Java API By Example, From Geeks To Geeks.

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


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.HtmlListboxRendererBase;
20
21 import javax.faces.component.UIComponent;
22 import javax.faces.context.FacesContext;
23
24
25 /**
26  * @author Manfred Geiler (latest modification by $Author: matze $)
27  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:59 $
28  * $Log: HtmlListboxRenderer.java,v $
29  * Revision 1.3 2004/10/13 11:50:59 matze
30  * renamed packages to org.apache
31  *
32  * Revision 1.2 2004/07/01 21:53:06 mwessendorf
33  * ASF switch
34  *
35  * Revision 1.1 2004/05/18 14:31:38 manolito
36  * user role support completely moved to components source tree
37  *
38  */

39 public class HtmlListboxRenderer
40         extends HtmlListboxRendererBase
41 {
42     protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent)
43     {
44         if (!UserRoleUtils.isEnabledOnUserRole(uiComponent))
45         {
46             return false;
47         }
48         else
49         {
50             return super.isDisabled(facesContext, uiComponent);
51         }
52     }
53 }
54
Popular Tags