KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > navmenu > jscookmenu > HtmlJSCookMenuTag


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.navmenu.jscookmenu;
17
18 import org.apache.myfaces.taglib.UIComponentTagBase;
19 import org.apache.myfaces.component.UserRoleAware;
20
21 import javax.faces.component.UIComponent;
22
23 /**
24  * @author Thomas Spiegl (latest modification by $Author: matzew $)
25  * @version $Revision: 1.4 $ $Date: 2005/02/18 17:19:30 $
26  */

27 public class HtmlJSCookMenuTag
28         extends UIComponentTagBase
29 {
30     private static final String JavaDoc COMPONENT_TYPE = "org.apache.myfaces.JSCookMenu".intern();
31     private static final String JavaDoc RENDERER_TYPE = "org.apache.myfaces.JSCookMenu".intern();
32
33     private static final String JavaDoc LAYOUT_ATTR = "layout";
34     private static final String JavaDoc THEME_ATTR = "theme";
35
36     private String JavaDoc _layout;
37     private String JavaDoc _theme;
38
39     // User Role support
40
private String JavaDoc _enabledOnUserRole;
41     private String JavaDoc _visibleOnUserRole;
42
43     public void release() {
44         super.release();
45         _layout=null;
46         _theme=null;
47         _enabledOnUserRole=null;
48         _visibleOnUserRole=null;
49     }
50     
51     public String JavaDoc getComponentType()
52     {
53         return COMPONENT_TYPE;
54     }
55
56     public String JavaDoc getRendererType()
57     {
58         return RENDERER_TYPE;
59     }
60
61     protected void setProperties(UIComponent component)
62     {
63         super.setProperties(component);
64
65         setStringProperty(component, LAYOUT_ATTR, _layout);
66         setStringProperty(component, THEME_ATTR, _theme);
67
68         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
69         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
70     }
71
72     public void setLayout(String JavaDoc layout)
73     {
74         _layout = layout;
75     }
76
77     public void setTheme(String JavaDoc theme)
78     {
79         _theme = theme;
80     }
81
82     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
83     {
84         _visibleOnUserRole = visibleOnUserRole;
85     }
86
87     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
88     {
89         _enabledOnUserRole = enabledOnUserRole;
90     }
91 }
92
Popular Tags