1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.shared_impl.taglib; |
20 | |
|
21 | |
import org.apache.myfaces.shared_impl.renderkit.JSFAttr; |
22 | |
|
23 | |
import javax.faces.component.UIComponent; |
24 | |
import javax.faces.webapp.UIComponentTag; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public abstract class UIComponentTagBase |
33 | |
extends UIComponentTag |
34 | |
{ |
35 | |
|
36 | |
|
37 | |
|
38 | |
private String _forceId; |
39 | 0 | private String _forceIdIndex = "true"; |
40 | |
private String _javascriptLocation; |
41 | |
private String _imageLocation; |
42 | |
private String _styleLocation; |
43 | |
|
44 | |
|
45 | |
private String _value; |
46 | |
private String _converter; |
47 | |
|
48 | |
|
49 | |
public void release() { |
50 | 0 | super.release(); |
51 | |
|
52 | 0 | _forceId=null; |
53 | |
|
54 | 0 | _forceIdIndex = "true"; |
55 | |
|
56 | 0 | _value=null; |
57 | 0 | _converter=null; |
58 | |
|
59 | 0 | _javascriptLocation = null; |
60 | 0 | _imageLocation = null; |
61 | 0 | _styleLocation = null; |
62 | 0 | } |
63 | |
|
64 | |
protected void setProperties(UIComponent component) |
65 | |
{ |
66 | 0 | super.setProperties(component); |
67 | |
|
68 | 0 | setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_ATTR, _forceId); |
69 | 0 | setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_INDEX_ATTR, _forceIdIndex); |
70 | 0 | if (_javascriptLocation != null) setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION, _javascriptLocation); |
71 | 0 | if (_imageLocation != null) setStringProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.IMAGE_LOCATION, _imageLocation); |
72 | 0 | if (_styleLocation != null) setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation); |
73 | |
|
74 | |
|
75 | |
|
76 | 0 | setValueProperty(component, _value); |
77 | 0 | setConverterProperty(component, _converter); |
78 | 0 | } |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
public void setForceId(String aForceId) |
88 | |
{ |
89 | 0 | _forceId = aForceId; |
90 | 0 | } |
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
public void setForceIdIndex(String aForceIdIndex) |
99 | |
{ |
100 | 0 | _forceIdIndex = aForceIdIndex; |
101 | 0 | } |
102 | |
|
103 | |
public void setValue(String value) |
104 | |
{ |
105 | 0 | _value = value; |
106 | 0 | } |
107 | |
|
108 | |
public void setConverter(String converter) |
109 | |
{ |
110 | 0 | _converter = converter; |
111 | 0 | } |
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
|
118 | |
|
119 | |
|
120 | |
public void setJavascriptLocation(String aJavascriptLocation) |
121 | |
{ |
122 | 0 | _javascriptLocation = aJavascriptLocation; |
123 | 0 | } |
124 | |
|
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
public void setImageLocation(String aImageLocation) |
132 | |
{ |
133 | 0 | _imageLocation = aImageLocation; |
134 | 0 | } |
135 | |
|
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
public void setStyleLocation(String aStyleLocation) |
143 | |
{ |
144 | 0 | _styleLocation = aStyleLocation; |
145 | 0 | } |
146 | |
|
147 | |
|
148 | |
|
149 | |
protected void setIntegerProperty(UIComponent component, String propName, String value) |
150 | |
{ |
151 | 0 | UIComponentTagUtils.setIntegerProperty(getFacesContext(), component, propName, value); |
152 | 0 | } |
153 | |
|
154 | |
protected void setLongProperty(UIComponent component, String propName, String value) |
155 | |
{ |
156 | 0 | UIComponentTagUtils.setLongProperty(getFacesContext(), component, propName, value); |
157 | 0 | } |
158 | |
|
159 | |
protected void setStringProperty(UIComponent component, String propName, String value) |
160 | |
{ |
161 | 0 | UIComponentTagUtils.setStringProperty(getFacesContext(), component, propName, value); |
162 | 0 | } |
163 | |
|
164 | |
protected void setBooleanProperty(UIComponent component, String propName, String value) |
165 | |
{ |
166 | 0 | UIComponentTagUtils.setBooleanProperty(getFacesContext(), component, propName, value); |
167 | 0 | } |
168 | |
|
169 | |
private void setValueProperty(UIComponent component, String value) |
170 | |
{ |
171 | 0 | UIComponentTagUtils.setValueProperty(getFacesContext(), component, value); |
172 | 0 | } |
173 | |
|
174 | |
private void setConverterProperty(UIComponent component, String value) |
175 | |
{ |
176 | 0 | UIComponentTagUtils.setConverterProperty(getFacesContext(), component, value); |
177 | 0 | } |
178 | |
|
179 | |
protected void setValidatorProperty(UIComponent component, String value) |
180 | |
{ |
181 | 0 | UIComponentTagUtils.setValidatorProperty(getFacesContext(), component, value); |
182 | 0 | } |
183 | |
|
184 | |
protected void setActionProperty(UIComponent component, String action) |
185 | |
{ |
186 | 0 | UIComponentTagUtils.setActionProperty(getFacesContext(), component, action); |
187 | 0 | } |
188 | |
|
189 | |
protected void setActionListenerProperty(UIComponent component, String actionListener) |
190 | |
{ |
191 | 0 | UIComponentTagUtils.setActionListenerProperty(getFacesContext(), component, actionListener); |
192 | 0 | } |
193 | |
|
194 | |
protected void setValueChangedListenerProperty(UIComponent component, String valueChangedListener) |
195 | |
{ |
196 | 0 | UIComponentTagUtils.setValueChangedListenerProperty(getFacesContext(), component, valueChangedListener); |
197 | 0 | } |
198 | |
|
199 | |
protected void setValueBinding(UIComponent component, |
200 | |
String propName, |
201 | |
String value) |
202 | |
{ |
203 | 0 | UIComponentTagUtils.setValueBinding(getFacesContext(), component, propName, value); |
204 | 0 | } |
205 | |
|
206 | |
|
207 | |
} |
208 | |
|