1 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 27 public class HtmlJSCookMenuTag 28 extends UIComponentTagBase 29 { 30 private static final String COMPONENT_TYPE = "org.apache.myfaces.JSCookMenu".intern(); 31 private static final String RENDERER_TYPE = "org.apache.myfaces.JSCookMenu".intern(); 32 33 private static final String LAYOUT_ATTR = "layout"; 34 private static final String THEME_ATTR = "theme"; 35 36 private String _layout; 37 private String _theme; 38 39 private String _enabledOnUserRole; 41 private String _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 getComponentType() 52 { 53 return COMPONENT_TYPE; 54 } 55 56 public String 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 layout) 73 { 74 _layout = layout; 75 } 76 77 public void setTheme(String theme) 78 { 79 _theme = theme; 80 } 81 82 public void setVisibleOnUserRole(String visibleOnUserRole) 83 { 84 _visibleOnUserRole = visibleOnUserRole; 85 } 86 87 public void setEnabledOnUserRole(String enabledOnUserRole) 88 { 89 _enabledOnUserRole = enabledOnUserRole; 90 } 91 } 92 | Popular Tags |