1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.taglib.html.ext;
20
21 import org.apache.myfaces.component.UserRoleAware;
22 import org.apache.myfaces.component.html.ext.HtmlMessages;
23 import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlMessagesTagBase;
24
25 import javax.faces.component.UIComponent;
26
27
28
29
30
31
32 public class HtmlMessagesTag
33 extends HtmlMessagesTagBase
34 {
35
36
37 public String getComponentType()
38 {
39 return HtmlMessages.COMPONENT_TYPE;
40 }
41
42 public String getRendererType()
43 {
44 return HtmlMessages.DEFAULT_RENDERER_TYPE;
45 }
46
47 private String _summaryFormat;
48 private String _globalSummaryFormat;
49 private String _detailFormat;
50 private String _enabledOnUserRole;
51 private String _visibleOnUserRole;
52 private String _replaceIdWithLabel;
53 private String _forceSpan;
54
55 public void release() {
56 super.release();
57
58 _summaryFormat=null;
59 _globalSummaryFormat=null;
60 _detailFormat=null;
61 _enabledOnUserRole=null;
62 _visibleOnUserRole=null;
63 _replaceIdWithLabel=null;
64 _forceSpan = null;
65 }
66
67 protected void setProperties(UIComponent component)
68 {
69 super.setProperties(component);
70
71 setStringProperty(component, "summaryFormat", _summaryFormat);
72 setStringProperty(component, "globalSummaryFormat", _globalSummaryFormat);
73 setStringProperty(component, "detailFormat", _detailFormat);
74 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
75 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
76 setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel);
77 setBooleanProperty(component, "forceSpan",_forceSpan ==null?Boolean.FALSE.toString():_forceSpan);
78 }
79
80 public void setSummaryFormat(String summaryFormat)
81 {
82 _summaryFormat = summaryFormat;
83 }
84
85 public void setGlobalSummaryFormat(String globalSummaryFormat)
86 {
87 _globalSummaryFormat = globalSummaryFormat;
88 }
89
90 public void setDetailFormat(String detailFormat)
91 {
92 _detailFormat = detailFormat;
93 }
94
95 public void setEnabledOnUserRole(String enabledOnUserRole)
96 {
97 _enabledOnUserRole = enabledOnUserRole;
98 }
99
100 public void setVisibleOnUserRole(String visibleOnUserRole)
101 {
102 _visibleOnUserRole = visibleOnUserRole;
103 }
104
105 public void setReplaceIdWithLabel(String replaceIdWithLabel)
106 {
107 _replaceIdWithLabel = replaceIdWithLabel;
108 }
109
110 public void setForceSpan(String forceSpan)
111 {
112 _forceSpan = forceSpan;
113 }
114 }