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.el.MethodExpression; |
24 | |
import javax.el.ValueExpression; |
25 | |
import javax.faces.component.UIComponent; |
26 | |
import javax.faces.webapp.UIComponentELTag; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 0 | public abstract class UIComponentELTagBase |
34 | |
extends UIComponentELTag |
35 | |
{ |
36 | |
|
37 | |
|
38 | |
|
39 | |
private ValueExpression _forceId; |
40 | |
|
41 | |
private ValueExpression _forceIdIndex; |
42 | 0 | private static final Boolean DEFAULT_FORCE_ID_INDEX_VALUE = Boolean.TRUE; |
43 | |
|
44 | |
private ValueExpression _javascriptLocation; |
45 | |
private ValueExpression _imageLocation; |
46 | |
private ValueExpression _styleLocation; |
47 | |
|
48 | |
|
49 | |
private ValueExpression _value; |
50 | |
private ValueExpression _converter; |
51 | |
|
52 | |
|
53 | |
public void release() { |
54 | 0 | super.release(); |
55 | |
|
56 | 0 | _forceId = null; |
57 | 0 | _forceIdIndex = null; |
58 | |
|
59 | 0 | _value=null; |
60 | 0 | _converter=null; |
61 | |
|
62 | 0 | _javascriptLocation = null; |
63 | 0 | _imageLocation = null; |
64 | 0 | _styleLocation = null; |
65 | 0 | } |
66 | |
|
67 | |
protected void setProperties(UIComponent component) |
68 | |
{ |
69 | 0 | super.setProperties(component); |
70 | |
|
71 | 0 | setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_ATTR, _forceId); |
72 | 0 | setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_INDEX_ATTR, _forceIdIndex, DEFAULT_FORCE_ID_INDEX_VALUE); |
73 | 0 | if (_javascriptLocation != null) setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION, _javascriptLocation); |
74 | 0 | if (_imageLocation != null) setStringProperty(component, JSFAttr.IMAGE_LOCATION, _imageLocation); |
75 | 0 | if (_styleLocation != null) setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation); |
76 | |
|
77 | |
|
78 | |
|
79 | 0 | setValueProperty(component, _value); |
80 | 0 | setConverterProperty(component, _converter); |
81 | 0 | } |
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
|
90 | |
public void setForceId(ValueExpression aForceId) |
91 | |
{ |
92 | 0 | _forceId = aForceId; |
93 | 0 | } |
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
public void setForceIdIndex(ValueExpression aForceIdIndex) |
102 | |
{ |
103 | 0 | _forceIdIndex = aForceIdIndex; |
104 | 0 | } |
105 | |
|
106 | |
public void setValue(ValueExpression value) |
107 | |
{ |
108 | 0 | _value = value; |
109 | 0 | } |
110 | |
|
111 | |
public void setConverter(ValueExpression converter) |
112 | |
{ |
113 | 0 | _converter = converter; |
114 | 0 | } |
115 | |
|
116 | |
|
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
public void setJavascriptLocation(ValueExpression aJavascriptLocation) |
124 | |
{ |
125 | 0 | _javascriptLocation = aJavascriptLocation; |
126 | 0 | } |
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
public void setImageLocation(ValueExpression aImageLocation) |
135 | |
{ |
136 | 0 | _imageLocation = aImageLocation; |
137 | 0 | } |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
public void setStyleLocation(ValueExpression aStyleLocation) |
146 | |
{ |
147 | 0 | _styleLocation = aStyleLocation; |
148 | 0 | } |
149 | |
|
150 | |
|
151 | |
|
152 | |
protected void setIntegerProperty(UIComponent component, String propName, ValueExpression value) |
153 | |
{ |
154 | 0 | UIComponentELTagUtils.setIntegerProperty(component, propName, value); |
155 | 0 | } |
156 | |
|
157 | |
protected void setIntegerProperty(UIComponent component, String propName, ValueExpression value, Integer defaultValue) |
158 | |
{ |
159 | 0 | UIComponentELTagUtils.setIntegerProperty(component, propName, value, defaultValue); |
160 | 0 | } |
161 | |
|
162 | |
protected void setLongProperty(UIComponent component, String propName, ValueExpression value) |
163 | |
{ |
164 | 0 | UIComponentELTagUtils.setLongProperty(component, propName, value); |
165 | 0 | } |
166 | |
|
167 | |
protected void setLongProperty(UIComponent component, String propName, ValueExpression value, Long defaultValue) |
168 | |
{ |
169 | 0 | UIComponentELTagUtils.setLongProperty(component, propName, value, defaultValue); |
170 | 0 | } |
171 | |
|
172 | |
@Deprecated |
173 | |
protected void setStringProperty(UIComponent component, String propName, String value) |
174 | |
{ |
175 | 0 | UIComponentTagUtils.setStringProperty(getFacesContext(), component, propName, value); |
176 | 0 | } |
177 | |
|
178 | |
protected void setStringProperty(UIComponent component, String propName, ValueExpression value) |
179 | |
{ |
180 | 0 | UIComponentELTagUtils.setStringProperty(component, propName, value); |
181 | 0 | } |
182 | |
|
183 | |
protected void setStringProperty(UIComponent component, String propName, ValueExpression value, String defaultValue) |
184 | |
{ |
185 | 0 | UIComponentELTagUtils.setStringProperty(component, propName, value, defaultValue); |
186 | 0 | } |
187 | |
|
188 | |
@Deprecated |
189 | |
protected void setBooleanProperty(UIComponent component, String propName, String value) |
190 | |
{ |
191 | 0 | UIComponentTagUtils.setBooleanProperty(getFacesContext(), component, propName, value); |
192 | 0 | } |
193 | |
|
194 | |
protected void setBooleanProperty(UIComponent component, String propName, ValueExpression value) |
195 | |
{ |
196 | 0 | UIComponentELTagUtils.setBooleanProperty(component, propName, value); |
197 | 0 | } |
198 | |
|
199 | |
protected void setBooleanProperty(UIComponent component, String propName, ValueExpression value, Boolean defaultValue) |
200 | |
{ |
201 | 0 | UIComponentELTagUtils.setBooleanProperty(component, propName, value, defaultValue); |
202 | 0 | } |
203 | |
|
204 | |
private void setValueProperty(UIComponent component, ValueExpression value) |
205 | |
{ |
206 | 0 | UIComponentELTagUtils.setValueProperty(getFacesContext(), component, value); |
207 | 0 | } |
208 | |
|
209 | |
private void setConverterProperty(UIComponent component, ValueExpression value) |
210 | |
{ |
211 | 0 | UIComponentELTagUtils.setConverterProperty(getFacesContext(), component, value); |
212 | 0 | } |
213 | |
|
214 | |
protected void addValidatorProperty(UIComponent component, MethodExpression value) |
215 | |
{ |
216 | 0 | UIComponentELTagUtils.addValidatorProperty(getFacesContext(), component, value); |
217 | 0 | } |
218 | |
|
219 | |
@Deprecated |
220 | |
protected void setActionProperty(UIComponent component, String action) |
221 | |
{ |
222 | 0 | UIComponentTagUtils.setActionProperty(getFacesContext(), component, action); |
223 | 0 | } |
224 | |
|
225 | |
protected void setActionProperty(UIComponent component, MethodExpression action) |
226 | |
{ |
227 | 0 | UIComponentELTagUtils.setActionProperty(getFacesContext(), component, action); |
228 | 0 | } |
229 | |
|
230 | |
@Deprecated |
231 | |
protected void setActionListenerProperty(UIComponent component, String actionListener) |
232 | |
{ |
233 | 0 | UIComponentTagUtils.setActionListenerProperty(getFacesContext(), component, actionListener); |
234 | 0 | } |
235 | |
|
236 | |
protected void setActionListenerProperty(UIComponent component, MethodExpression actionListener) |
237 | |
{ |
238 | 0 | UIComponentELTagUtils.addActionListenerProperty(getFacesContext(), component, actionListener); |
239 | 0 | } |
240 | |
|
241 | |
protected void addValueChangedListenerProperty(UIComponent component, MethodExpression valueChangedListener) |
242 | |
{ |
243 | 0 | UIComponentELTagUtils.addValueChangedListenerProperty(getFacesContext(), component, valueChangedListener); |
244 | 0 | } |
245 | |
|
246 | |
protected void setValueBinding(UIComponent component, |
247 | |
String propName, |
248 | |
ValueExpression value) |
249 | |
{ |
250 | 0 | UIComponentELTagUtils.setValueBinding(getFacesContext(), component, propName, value); |
251 | 0 | } |
252 | |
|
253 | |
protected Object evaluateValueExpression(ValueExpression expression) |
254 | |
{ |
255 | 0 | return UIComponentELTagUtils.evaluateValueExpression(getFacesContext().getELContext(), expression); |
256 | |
} |
257 | |
|
258 | |
|
259 | |
} |