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.HtmlMessages; 20 import org.apache.myfaces.taglib.html.HtmlMessagesTagBase; 21 22 import javax.faces.component.UIComponent; 23 24 25 54 public class HtmlMessagesTag 55 extends HtmlMessagesTagBase 56 { 57 59 public String getComponentType() 60 { 61 return HtmlMessages.COMPONENT_TYPE; 62 } 63 64 public String getRendererType() 65 { 66 return "org.apache.myfaces.Messages"; 67 } 68 69 private String _summaryFormat; 70 private String _globalSummaryFormat; 71 private String _detailFormat; 72 private String _enabledOnUserRole; 73 private String _visibleOnUserRole; 74 private String _replaceIdWithLabel; 75 76 public void release() { 77 super.release(); 78 79 _summaryFormat=null; 80 _globalSummaryFormat=null; 81 _detailFormat=null; 82 _enabledOnUserRole=null; 83 _visibleOnUserRole=null; 84 _replaceIdWithLabel=null; 85 } 86 87 protected void setProperties(UIComponent component) 88 { 89 super.setProperties(component); 90 91 setStringProperty(component, "summaryFormat", _summaryFormat); 92 setStringProperty(component, "globalSummaryFormat", _globalSummaryFormat); 93 setStringProperty(component, "detailFormat", _detailFormat); 94 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole); 95 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole); 96 setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel); 97 } 98 99 public void setSummaryFormat(String summaryFormat) 100 { 101 _summaryFormat = summaryFormat; 102 } 103 104 public void setGlobalSummaryFormat(String globalSummaryFormat) 105 { 106 _globalSummaryFormat = globalSummaryFormat; 107 } 108 109 public void setDetailFormat(String detailFormat) 110 { 111 _detailFormat = detailFormat; 112 } 113 114 public void setEnabledOnUserRole(String enabledOnUserRole) 115 { 116 _enabledOnUserRole = enabledOnUserRole; 117 } 118 119 public void setVisibleOnUserRole(String visibleOnUserRole) 120 { 121 _visibleOnUserRole = visibleOnUserRole; 122 } 123 124 public void setReplaceIdWithLabel(String replaceIdWithLabel) 125 { 126 _replaceIdWithLabel = replaceIdWithLabel; 127 } 128 } 129 | Popular Tags |