1 16 package org.apache.myfaces.taglib.html.ext; 17 18 import org.apache.myfaces.component.UserRoleAware; 19 import org.apache.myfaces.component.html.ext.HtmlMessage; 20 import org.apache.myfaces.taglib.html.HtmlMessageTagBase; 21 22 import javax.faces.component.UIComponent; 23 24 59 public class HtmlMessageTag 60 extends HtmlMessageTagBase 61 { 62 64 public String getComponentType() 65 { 66 return HtmlMessage.COMPONENT_TYPE; 67 } 68 69 public String getRendererType() 70 { 71 return "org.apache.myfaces.Message"; 72 } 73 74 private String _summaryFormat; 75 private String _detailFormat; 76 private String _enabledOnUserRole; 77 private String _visibleOnUserRole; 78 private String _replaceIdWithLabel; 79 80 public void release() { 81 super.release(); 82 83 _summaryFormat = null; 84 _detailFormat = null; 85 _enabledOnUserRole = null; 86 _visibleOnUserRole = null; 87 _replaceIdWithLabel = null; 88 } 89 protected void setProperties(UIComponent component) 90 { 91 super.setProperties(component); 92 93 setStringProperty(component, "summaryFormat", _summaryFormat); 94 setStringProperty(component, "detailFormat", _detailFormat); 95 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole); 96 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole); 97 setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel); 98 } 99 100 public void setSummaryFormat(String summaryFormat) 101 { 102 _summaryFormat = summaryFormat; 103 } 104 105 public void setDetailFormat(String detailFormat) 106 { 107 _detailFormat = detailFormat; 108 } 109 110 public void setEnabledOnUserRole(String enabledOnUserRole) 111 { 112 _enabledOnUserRole = enabledOnUserRole; 113 } 114 115 public void setVisibleOnUserRole(String visibleOnUserRole) 116 { 117 _visibleOnUserRole = visibleOnUserRole; 118 } 119 120 public void setReplaceIdWithLabel(String replaceIdWithLabel) 121 { 122 _replaceIdWithLabel = replaceIdWithLabel; 123 } 124 } 125 | Popular Tags |