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.HtmlCommandLink;
23 import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlCommandLinkTagBase;
24
25 import javax.faces.component.UIComponent;
26
27
28
29
30
31 public class HtmlCommandLinkTag
32 extends HtmlCommandLinkTagBase
33 {
34
35
36 public String getComponentType()
37 {
38 return HtmlCommandLink.COMPONENT_TYPE;
39 }
40
41 public String getRendererType()
42 {
43 return HtmlCommandLink.DEFAULT_RENDERER_TYPE;
44 }
45
46
47
48 private String _enabledOnUserRole;
49 private String _visibleOnUserRole;
50
51 private String _actionFor;
52 private String _disabled;
53 private String _disabledStyle;
54 private String _disabledStyleClass;
55
56 public void release() {
57 super.release();
58
59 _enabledOnUserRole=null;
60 _visibleOnUserRole=null;
61 _actionFor = null;
62 _disabled = null;
63 _disabledStyle = null;
64 _disabledStyleClass = null;
65 }
66
67 protected void setProperties(UIComponent component)
68 {
69 super.setProperties(component);
70 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
71 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
72 setStringProperty(component, "actionFor", _actionFor);
73 setBooleanProperty(component, "disabled", _disabled);
74 setStringProperty(component, "disabledStyle",_disabledStyle);
75 setStringProperty(component, "disabledStyleClass",_disabledStyleClass);
76 }
77
78
79 public void setEnabledOnUserRole(String enabledOnUserRole)
80 {
81 _enabledOnUserRole = enabledOnUserRole;
82 }
83
84 public void setVisibleOnUserRole(String visibleOnUserRole)
85 {
86 _visibleOnUserRole = visibleOnUserRole;
87 }
88
89 public void setActionFor(String actionFor)
90 {
91 _actionFor = actionFor;
92 }
93
94 public void setDisabled(String disabled)
95 {
96 _disabled = disabled;
97 }
98
99 public void setDisabledStyle(String disabledStyle)
100 {
101 _disabledStyle = disabledStyle;
102 }
103
104 public void setDisabledStyleClass(String disabledStyleClass)
105 {
106 _disabledStyleClass = disabledStyleClass;
107 }
108 }