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.HtmlMessage;
23 import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlMessageTagBase;
24
25 import javax.faces.component.UIComponent;
26
27
28
29
30
31 public class HtmlMessageTag
32 extends HtmlMessageTagBase
33 {
34
35
36 public String getComponentType()
37 {
38 return HtmlMessage.COMPONENT_TYPE;
39 }
40
41 public String getRendererType()
42 {
43 return HtmlMessage.DEFAULT_RENDERER_TYPE;
44 }
45
46 private String _summaryFormat;
47 private String _detailFormat;
48 private String _enabledOnUserRole;
49 private String _visibleOnUserRole;
50 private String _replaceIdWithLabel;
51 private String _forceSpan;
52
53 public void release() {
54 super.release();
55
56 _summaryFormat = null;
57 _detailFormat = null;
58 _enabledOnUserRole = null;
59 _visibleOnUserRole = null;
60 _replaceIdWithLabel = null;
61 _forceSpan = null;
62 }
63 protected void setProperties(UIComponent component)
64 {
65 super.setProperties(component);
66
67 setStringProperty(component, "summaryFormat", _summaryFormat);
68 setStringProperty(component, "detailFormat", _detailFormat);
69 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
70 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
71 setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel);
72 setBooleanProperty(component, "forceSpan",_forceSpan ==null?Boolean.FALSE.toString():_forceSpan);
73 }
74
75 public void setSummaryFormat(String summaryFormat)
76 {
77 _summaryFormat = summaryFormat;
78 }
79
80 public void setDetailFormat(String detailFormat)
81 {
82 _detailFormat = detailFormat;
83 }
84
85 public void setEnabledOnUserRole(String enabledOnUserRole)
86 {
87 _enabledOnUserRole = enabledOnUserRole;
88 }
89
90 public void setVisibleOnUserRole(String visibleOnUserRole)
91 {
92 _visibleOnUserRole = visibleOnUserRole;
93 }
94
95 public void setReplaceIdWithLabel(String replaceIdWithLabel)
96 {
97 _replaceIdWithLabel = replaceIdWithLabel;
98 }
99
100 public void setForceSpan(String forceSpan)
101 {
102 _forceSpan = forceSpan;
103 }
104 }