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.HtmlCommandButton;
23 import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlCommandButtonTagBase;
24
25 import javax.faces.component.UIComponent;
26
27
28
29
30
31 public class HtmlCommandButtonTag
32 extends HtmlCommandButtonTagBase
33 {
34 public String getComponentType()
35 {
36 return HtmlCommandButton.COMPONENT_TYPE;
37 }
38
39 public String getRendererType()
40 {
41 return HtmlCommandButton.DEFAULT_RENDERER_TYPE;
42 }
43
44 private String _enabledOnUserRole;
45 private String _visibleOnUserRole;
46 private String _actionFor;
47
48 public void release() {
49 super.release();
50
51 _enabledOnUserRole=null;
52 _visibleOnUserRole=null;
53 _actionFor=null;
54 }
55
56 protected void setProperties(UIComponent component)
57 {
58 super.setProperties(component);
59 setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
60 setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
61 setStringProperty(component, "actionFor", _actionFor);
62 }
63
64 public void setEnabledOnUserRole(String enabledOnUserRole)
65 {
66 _enabledOnUserRole = enabledOnUserRole;
67 }
68
69 public void setVisibleOnUserRole(String visibleOnUserRole)
70 {
71 _visibleOnUserRole = visibleOnUserRole;
72 }
73
74 public void setActionFor(String actionFor)
75 {
76 _actionFor = actionFor;
77 }
78
79 }