1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.teeda.core.taglib; |
17 | |
|
18 | |
import javax.faces.application.Application; |
19 | |
import javax.faces.component.EditableValueHolder; |
20 | |
import javax.faces.component.UICommand; |
21 | |
import javax.faces.component.UIComponent; |
22 | |
import javax.faces.component.ValueHolder; |
23 | |
import javax.faces.context.FacesContext; |
24 | |
import javax.faces.convert.Converter; |
25 | |
import javax.faces.el.MethodBinding; |
26 | |
import javax.faces.event.ActionEvent; |
27 | |
import javax.faces.event.ValueChangeEvent; |
28 | |
import javax.faces.webapp.UIComponentTag; |
29 | |
|
30 | |
import org.seasar.teeda.core.JsfConstants; |
31 | |
import org.seasar.teeda.core.el.SimpleMethodBinding; |
32 | |
import org.seasar.teeda.core.exception.NoEditableValueHolderRuntimeException; |
33 | |
import org.seasar.teeda.core.exception.NoUICommandRuntimeException; |
34 | |
import org.seasar.teeda.core.exception.NoValueHolderRuntimeException; |
35 | |
import org.seasar.teeda.core.exception.NoValueReferenceRuntimeException; |
36 | |
import org.seasar.teeda.core.util.BindingUtil; |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
public abstract class UIComponentTagBase extends UIComponentTag { |
44 | |
|
45 | 6 | private static final Class[] VALIDATOR_ARGTYPES = { FacesContext.class, |
46 | |
UIComponent.class, Object.class }; |
47 | |
|
48 | 1 | private static final Class[] ACTION_LISTENER_ARGS = { ActionEvent.class }; |
49 | |
|
50 | 1 | private static final Class[] VALUE_LISTENER_ARGS = { ValueChangeEvent.class }; |
51 | |
|
52 | 102 | private String styleClass = null; |
53 | |
|
54 | 102 | private String title = null; |
55 | |
|
56 | 102 | private String enabledClass = null; |
57 | |
|
58 | 102 | private String disabledClass = null; |
59 | |
|
60 | 102 | private String onclick = null; |
61 | |
|
62 | 102 | private String ondblclick = null; |
63 | |
|
64 | 102 | private String onmousedown = null; |
65 | |
|
66 | 102 | private String onmouseover = null; |
67 | |
|
68 | 102 | private String onmousemove = null; |
69 | |
|
70 | 102 | private String onmouseout = null; |
71 | |
|
72 | 102 | private String onkeypress = null; |
73 | |
|
74 | 102 | private String onkeydown = null; |
75 | |
|
76 | 102 | private String onkeyup = null; |
77 | |
|
78 | 102 | private String lang = null; |
79 | |
|
80 | 102 | private String dir = null; |
81 | |
|
82 | 102 | private String height = null; |
83 | |
|
84 | 102 | private String width = null; |
85 | |
|
86 | 102 | private String cellspacing = null; |
87 | |
|
88 | 102 | private String cellpadding = null; |
89 | |
|
90 | 102 | private String disabled = null; |
91 | |
|
92 | 102 | private String size = null; |
93 | |
|
94 | 102 | private String tabindex = null; |
95 | |
|
96 | 102 | private String checked = null; |
97 | |
|
98 | 102 | private String border = null; |
99 | |
|
100 | 102 | private String readonly = null; |
101 | |
|
102 | 102 | private String ismap = null; |
103 | |
|
104 | 102 | private String maxlength = null; |
105 | |
|
106 | 102 | private String rows = null; |
107 | |
|
108 | 102 | private String cols = null; |
109 | |
|
110 | 102 | private String formatStyle = null; |
111 | |
|
112 | 102 | private String dateStyle = null; |
113 | |
|
114 | 102 | private String timeStyle = null; |
115 | |
|
116 | 102 | private String timezone = null; |
117 | |
|
118 | 102 | private String formatPattern = null; |
119 | |
|
120 | 102 | private String accept = null; |
121 | |
|
122 | 102 | private String acceptcharset = null; |
123 | |
|
124 | 102 | private String accesskey = null; |
125 | |
|
126 | 102 | private String action = null; |
127 | |
|
128 | 102 | private String alt = null; |
129 | |
|
130 | 102 | private String charset = null; |
131 | |
|
132 | 102 | private String coords = null; |
133 | |
|
134 | 102 | private String enctype = null; |
135 | |
|
136 | 102 | private String htmlFor = null; |
137 | |
|
138 | 102 | private String href = null; |
139 | |
|
140 | 102 | private String hreflang = null; |
141 | |
|
142 | 102 | private String hspace = null; |
143 | |
|
144 | 102 | private String longdesc = null; |
145 | |
|
146 | 102 | private String method = null; |
147 | |
|
148 | 102 | private String multiple = null; |
149 | |
|
150 | 102 | private String name = null; |
151 | |
|
152 | 102 | private String onblur = null; |
153 | |
|
154 | 102 | private String onchange = null; |
155 | |
|
156 | 102 | private String onfocus = null; |
157 | |
|
158 | 102 | private String onmouseup = null; |
159 | |
|
160 | 102 | private String onreset = null; |
161 | |
|
162 | 102 | private String onselect = null; |
163 | |
|
164 | 102 | private String onsubmit = null; |
165 | |
|
166 | 102 | private String rel = null; |
167 | |
|
168 | 102 | private String rev = null; |
169 | |
|
170 | 102 | private String selected = null; |
171 | |
|
172 | 102 | private String shape = null; |
173 | |
|
174 | 102 | private String src = null; |
175 | |
|
176 | 102 | private String style = null; |
177 | |
|
178 | 102 | private String target = null; |
179 | |
|
180 | 102 | private String type = null; |
181 | |
|
182 | 102 | private String usemap = null; |
183 | |
|
184 | 102 | private String value = null; |
185 | |
|
186 | 102 | private String summary = null; |
187 | |
|
188 | 102 | private String bgcolor = null; |
189 | |
|
190 | 102 | private String frame = null; |
191 | |
|
192 | 102 | private String rules = null; |
193 | |
|
194 | 102 | private String converter = null; |
195 | |
|
196 | |
public UIComponentTagBase() { |
197 | 102 | super(); |
198 | 102 | } |
199 | |
|
200 | |
public String getAccept() { |
201 | 4 | return accept; |
202 | |
} |
203 | |
|
204 | |
public void setAccept(String accept) { |
205 | 3 | this.accept = accept; |
206 | 3 | } |
207 | |
|
208 | |
public String getAcceptcharset() { |
209 | 4 | return acceptcharset; |
210 | |
} |
211 | |
|
212 | |
public void setAcceptcharset(String acceptcharset) { |
213 | 3 | this.acceptcharset = acceptcharset; |
214 | 3 | } |
215 | |
|
216 | |
public String getAccesskey() { |
217 | 2 | return accesskey; |
218 | |
} |
219 | |
|
220 | |
public void setAccesskey(String accesskey) { |
221 | 16 | this.accesskey = accesskey; |
222 | 16 | } |
223 | |
|
224 | |
public String getAction() { |
225 | 9 | return action; |
226 | |
} |
227 | |
|
228 | |
public void setAction(String action) { |
229 | 6 | this.action = action; |
230 | 6 | } |
231 | |
|
232 | |
public String getAlt() { |
233 | 10 | return alt; |
234 | |
} |
235 | |
|
236 | |
public void setAlt(String alt) { |
237 | 6 | this.alt = alt; |
238 | 6 | } |
239 | |
|
240 | |
public String getBgcolor() { |
241 | 4 | return bgcolor; |
242 | |
} |
243 | |
|
244 | |
public void setBgcolor(String bgcolor) { |
245 | 4 | this.bgcolor = bgcolor; |
246 | 4 | } |
247 | |
|
248 | |
public String getBorder() { |
249 | 7 | return border; |
250 | |
} |
251 | |
|
252 | |
public void setBorder(String border) { |
253 | 6 | this.border = border; |
254 | 6 | } |
255 | |
|
256 | |
public String getCellpadding() { |
257 | 4 | return cellpadding; |
258 | |
} |
259 | |
|
260 | |
public void setCellpadding(String cellpadding) { |
261 | 4 | this.cellpadding = cellpadding; |
262 | 4 | } |
263 | |
|
264 | |
public String getCellspacing() { |
265 | 4 | return cellspacing; |
266 | |
} |
267 | |
|
268 | |
public void setCellspacing(String cellspacing) { |
269 | 4 | this.cellspacing = cellspacing; |
270 | 4 | } |
271 | |
|
272 | |
public String getCharset() { |
273 | 5 | return charset; |
274 | |
} |
275 | |
|
276 | |
public void setCharset(String charset) { |
277 | 4 | this.charset = charset; |
278 | 4 | } |
279 | |
|
280 | |
public String getChecked() { |
281 | 2 | return checked; |
282 | |
} |
283 | |
|
284 | |
public void setChecked(String checked) { |
285 | 2 | this.checked = checked; |
286 | 2 | } |
287 | |
|
288 | |
public String getCols() { |
289 | 3 | return cols; |
290 | |
} |
291 | |
|
292 | |
public void setCols(String cols) { |
293 | 3 | this.cols = cols; |
294 | 3 | } |
295 | |
|
296 | |
public String getConverter() { |
297 | 2 | return converter; |
298 | |
} |
299 | |
|
300 | |
public void setConverter(String converter) { |
301 | 17 | this.converter = converter; |
302 | 17 | } |
303 | |
|
304 | |
public String getCoords() { |
305 | 5 | return coords; |
306 | |
} |
307 | |
|
308 | |
public void setCoords(String coords) { |
309 | 4 | this.coords = coords; |
310 | 4 | } |
311 | |
|
312 | |
public String getDateStyle() { |
313 | 2 | return dateStyle; |
314 | |
} |
315 | |
|
316 | |
public void setDateStyle(String dateStyle) { |
317 | 2 | this.dateStyle = dateStyle; |
318 | 2 | } |
319 | |
|
320 | |
public String getDir() { |
321 | 2 | return dir; |
322 | |
} |
323 | |
|
324 | |
public void setDir(String dir) { |
325 | 20 | this.dir = dir; |
326 | 20 | } |
327 | |
|
328 | |
public String getDisabled() { |
329 | 2 | return disabled; |
330 | |
} |
331 | |
|
332 | |
public void setDisabled(String disabled) { |
333 | 13 | this.disabled = disabled; |
334 | 13 | } |
335 | |
|
336 | |
public String getDisabledClass() { |
337 | 8 | return disabledClass; |
338 | |
} |
339 | |
|
340 | |
public void setDisabledClass(String disabledClass) { |
341 | 8 | this.disabledClass = disabledClass; |
342 | 8 | } |
343 | |
|
344 | |
public String getEnabledClass() { |
345 | 8 | return enabledClass; |
346 | |
} |
347 | |
|
348 | |
public void setEnabledClass(String enabledClass) { |
349 | 8 | this.enabledClass = enabledClass; |
350 | 8 | } |
351 | |
|
352 | |
public String getEnctype() { |
353 | 4 | return enctype; |
354 | |
} |
355 | |
|
356 | |
public void setEnctype(String enctype) { |
357 | 3 | this.enctype = enctype; |
358 | 3 | } |
359 | |
|
360 | |
public String getFormatPattern() { |
361 | 2 | return formatPattern; |
362 | |
} |
363 | |
|
364 | |
public void setFormatPattern(String formatPattern) { |
365 | 2 | this.formatPattern = formatPattern; |
366 | 2 | } |
367 | |
|
368 | |
public String getFormatStyle() { |
369 | 2 | return formatStyle; |
370 | |
} |
371 | |
|
372 | |
public void setFormatStyle(String formatStyle) { |
373 | 2 | this.formatStyle = formatStyle; |
374 | 2 | } |
375 | |
|
376 | |
public String getFrame() { |
377 | 4 | return frame; |
378 | |
} |
379 | |
|
380 | |
public void setFrame(String frame) { |
381 | 4 | this.frame = frame; |
382 | 4 | } |
383 | |
|
384 | |
public String getHeight() { |
385 | 3 | return height; |
386 | |
} |
387 | |
|
388 | |
public void setHeight(String height) { |
389 | 3 | this.height = height; |
390 | 3 | } |
391 | |
|
392 | |
public String getHref() { |
393 | 2 | return href; |
394 | |
} |
395 | |
|
396 | |
public void setHref(String href) { |
397 | 2 | this.href = href; |
398 | 2 | } |
399 | |
|
400 | |
public String getHreflang() { |
401 | 5 | return hreflang; |
402 | |
} |
403 | |
|
404 | |
public void setHreflang(String hreflang) { |
405 | 4 | this.hreflang = hreflang; |
406 | 4 | } |
407 | |
|
408 | |
public String getHspace() { |
409 | 2 | return hspace; |
410 | |
} |
411 | |
|
412 | |
public void setHspace(String hspace) { |
413 | 2 | this.hspace = hspace; |
414 | 2 | } |
415 | |
|
416 | |
public String getHtmlFor() { |
417 | 2 | return htmlFor; |
418 | |
} |
419 | |
|
420 | |
public void setHtmlFor(String htmlFor) { |
421 | 2 | this.htmlFor = htmlFor; |
422 | 2 | } |
423 | |
|
424 | |
public String getIsmap() { |
425 | 3 | return ismap; |
426 | |
} |
427 | |
|
428 | |
public void setIsmap(String ismap) { |
429 | 3 | this.ismap = ismap; |
430 | 3 | } |
431 | |
|
432 | |
public String getLang() { |
433 | 2 | return lang; |
434 | |
} |
435 | |
|
436 | |
public void setLang(String lang) { |
437 | 20 | this.lang = lang; |
438 | 20 | } |
439 | |
|
440 | |
public String getLongdesc() { |
441 | 3 | return longdesc; |
442 | |
} |
443 | |
|
444 | |
public void setLongdesc(String longdesc) { |
445 | 3 | this.longdesc = longdesc; |
446 | 3 | } |
447 | |
|
448 | |
public String getMaxlength() { |
449 | 13 | return maxlength; |
450 | |
} |
451 | |
|
452 | |
public void setMaxlength(String maxlength) { |
453 | 3 | this.maxlength = maxlength; |
454 | 3 | } |
455 | |
|
456 | |
public String getMethod() { |
457 | 2 | return method; |
458 | |
} |
459 | |
|
460 | |
public void setMethod(String method) { |
461 | 2 | this.method = method; |
462 | 2 | } |
463 | |
|
464 | |
public String getMultiple() { |
465 | 2 | return multiple; |
466 | |
} |
467 | |
|
468 | |
public void setMultiple(String multiple) { |
469 | 2 | this.multiple = multiple; |
470 | 2 | } |
471 | |
|
472 | |
public String getName() { |
473 | 3 | return name; |
474 | |
} |
475 | |
|
476 | |
public void setName(String name) { |
477 | 3 | this.name = name; |
478 | 3 | } |
479 | |
|
480 | |
public String getOnblur() { |
481 | 2 | return onblur; |
482 | |
} |
483 | |
|
484 | |
public void setOnblur(String onblur) { |
485 | 16 | this.onblur = onblur; |
486 | 16 | } |
487 | |
|
488 | |
public String getOnchange() { |
489 | 17 | return onchange; |
490 | |
} |
491 | |
|
492 | |
public void setOnchange(String onchange) { |
493 | 13 | this.onchange = onchange; |
494 | 13 | } |
495 | |
|
496 | |
public String getOnclick() { |
497 | 2 | return onclick; |
498 | |
} |
499 | |
|
500 | |
public void setOnclick(String onclick) { |
501 | 20 | this.onclick = onclick; |
502 | 20 | } |
503 | |
|
504 | |
public String getOndblclick() { |
505 | 2 | return ondblclick; |
506 | |
} |
507 | |
|
508 | |
public void setOndblclick(String ondblclick) { |
509 | 20 | this.ondblclick = ondblclick; |
510 | 20 | } |
511 | |
|
512 | |
public String getOnfocus() { |
513 | 2 | return onfocus; |
514 | |
} |
515 | |
|
516 | |
public void setOnfocus(String onfocus) { |
517 | 16 | this.onfocus = onfocus; |
518 | 16 | } |
519 | |
|
520 | |
public String getOnkeydown() { |
521 | 2 | return onkeydown; |
522 | |
} |
523 | |
|
524 | |
public void setOnkeydown(String onkeydown) { |
525 | 20 | this.onkeydown = onkeydown; |
526 | 20 | } |
527 | |
|
528 | |
public String getOnkeypress() { |
529 | 2 | return onkeypress; |
530 | |
} |
531 | |
|
532 | |
public void setOnkeypress(String onkeypress) { |
533 | 20 | this.onkeypress = onkeypress; |
534 | 20 | } |
535 | |
|
536 | |
public String getOnkeyup() { |
537 | 2 | return onkeyup; |
538 | |
} |
539 | |
|
540 | |
public void setOnkeyup(String onkeyup) { |
541 | 20 | this.onkeyup = onkeyup; |
542 | 20 | } |
543 | |
|
544 | |
public String getOnmousedown() { |
545 | 2 | return onmousedown; |
546 | |
} |
547 | |
|
548 | |
public void setOnmousedown(String onmousedown) { |
549 | 20 | this.onmousedown = onmousedown; |
550 | 20 | } |
551 | |
|
552 | |
public String getOnmousemove() { |
553 | 2 | return onmousemove; |
554 | |
} |
555 | |
|
556 | |
public void setOnmousemove(String onmousemove) { |
557 | 20 | this.onmousemove = onmousemove; |
558 | 20 | } |
559 | |
|
560 | |
public String getOnmouseout() { |
561 | 2 | return onmouseout; |
562 | |
} |
563 | |
|
564 | |
public void setOnmouseout(String onmouseout) { |
565 | 19 | this.onmouseout = onmouseout; |
566 | 19 | } |
567 | |
|
568 | |
public String getOnmouseover() { |
569 | 2 | return onmouseover; |
570 | |
} |
571 | |
|
572 | |
public void setOnmouseover(String onmouseover) { |
573 | 19 | this.onmouseover = onmouseover; |
574 | 19 | } |
575 | |
|
576 | |
public String getOnmouseup() { |
577 | 2 | return onmouseup; |
578 | |
} |
579 | |
|
580 | |
public void setOnmouseup(String onmouseup) { |
581 | 20 | this.onmouseup = onmouseup; |
582 | 20 | } |
583 | |
|
584 | |
public String getOnreset() { |
585 | 4 | return onreset; |
586 | |
} |
587 | |
|
588 | |
public void setOnreset(String onreset) { |
589 | 3 | this.onreset = onreset; |
590 | 3 | } |
591 | |
|
592 | |
public String getOnselect() { |
593 | 17 | return onselect; |
594 | |
} |
595 | |
|
596 | |
public void setOnselect(String onselect) { |
597 | 13 | this.onselect = onselect; |
598 | 13 | } |
599 | |
|
600 | |
public String getOnsubmit() { |
601 | 4 | return onsubmit; |
602 | |
} |
603 | |
|
604 | |
public void setOnsubmit(String onsubmit) { |
605 | 3 | this.onsubmit = onsubmit; |
606 | 3 | } |
607 | |
|
608 | |
public String getReadonly() { |
609 | 14 | return readonly; |
610 | |
} |
611 | |
|
612 | |
public void setReadonly(String readonly) { |
613 | 14 | this.readonly = readonly; |
614 | 14 | } |
615 | |
|
616 | |
public String getRel() { |
617 | 5 | return rel; |
618 | |
} |
619 | |
|
620 | |
public void setRel(String rel) { |
621 | 4 | this.rel = rel; |
622 | 4 | } |
623 | |
|
624 | |
public String getRev() { |
625 | 5 | return rev; |
626 | |
} |
627 | |
|
628 | |
public void setRev(String rev) { |
629 | 4 | this.rev = rev; |
630 | 4 | } |
631 | |
|
632 | |
public String getRows() { |
633 | 4 | return rows; |
634 | |
} |
635 | |
|
636 | |
public void setRows(String rows) { |
637 | 4 | this.rows = rows; |
638 | 4 | } |
639 | |
|
640 | |
public String getRules() { |
641 | 4 | return rules; |
642 | |
} |
643 | |
|
644 | |
public void setRules(String rules) { |
645 | 4 | this.rules = rules; |
646 | 4 | } |
647 | |
|
648 | |
public String getSelected() { |
649 | 2 | return selected; |
650 | |
} |
651 | |
|
652 | |
public void setSelected(String selected) { |
653 | 2 | this.selected = selected; |
654 | 2 | } |
655 | |
|
656 | |
public String getShape() { |
657 | 5 | return shape; |
658 | |
} |
659 | |
|
660 | |
public void setShape(String shape) { |
661 | 4 | this.shape = shape; |
662 | 4 | } |
663 | |
|
664 | |
public String getSize() { |
665 | 6 | return size; |
666 | |
} |
667 | |
|
668 | |
public void setSize(String size) { |
669 | 6 | this.size = size; |
670 | 6 | } |
671 | |
|
672 | |
public String getSrc() { |
673 | 2 | return src; |
674 | |
} |
675 | |
|
676 | |
public void setSrc(String src) { |
677 | 2 | this.src = src; |
678 | 2 | } |
679 | |
|
680 | |
public String getStyle() { |
681 | 2 | return style; |
682 | |
} |
683 | |
|
684 | |
public void setStyle(String style) { |
685 | 25 | this.style = style; |
686 | 25 | } |
687 | |
|
688 | |
public String getStyleClass() { |
689 | 2 | return styleClass; |
690 | |
} |
691 | |
|
692 | |
public void setStyleClass(String styleClass) { |
693 | 25 | this.styleClass = styleClass; |
694 | 25 | } |
695 | |
|
696 | |
public String getSummary() { |
697 | 4 | return summary; |
698 | |
} |
699 | |
|
700 | |
public void setSummary(String summary) { |
701 | 4 | this.summary = summary; |
702 | 4 | } |
703 | |
|
704 | |
public String getTabindex() { |
705 | 2 | return tabindex; |
706 | |
} |
707 | |
|
708 | |
public void setTabindex(String tabindex) { |
709 | 16 | this.tabindex = tabindex; |
710 | 16 | } |
711 | |
|
712 | |
public String getTarget() { |
713 | 7 | return target; |
714 | |
} |
715 | |
|
716 | |
public void setTarget(String target) { |
717 | 5 | this.target = target; |
718 | 5 | } |
719 | |
|
720 | |
public String getTimeStyle() { |
721 | 2 | return timeStyle; |
722 | |
} |
723 | |
|
724 | |
public void setTimeStyle(String timeStyle) { |
725 | 2 | this.timeStyle = timeStyle; |
726 | 2 | } |
727 | |
|
728 | |
public String getTimezone() { |
729 | 2 | return timezone; |
730 | |
} |
731 | |
|
732 | |
public void setTimezone(String timezone) { |
733 | 2 | this.timezone = timezone; |
734 | 2 | } |
735 | |
|
736 | |
public String getTitle() { |
737 | 2 | return title; |
738 | |
} |
739 | |
|
740 | |
public void setTitle(String title) { |
741 | 24 | this.title = title; |
742 | 24 | } |
743 | |
|
744 | |
public String getType() { |
745 | 5 | return type; |
746 | |
} |
747 | |
|
748 | |
public void setType(String type) { |
749 | 4 | this.type = type; |
750 | 4 | } |
751 | |
|
752 | |
public String getUsemap() { |
753 | 3 | return usemap; |
754 | |
} |
755 | |
|
756 | |
public void setUsemap(String usemap) { |
757 | 3 | this.usemap = usemap; |
758 | 3 | } |
759 | |
|
760 | |
public String getValue() { |
761 | 2 | return value; |
762 | |
} |
763 | |
|
764 | |
public void setValue(String value) { |
765 | 21 | this.value = value; |
766 | 21 | } |
767 | |
|
768 | |
public String getWidth() { |
769 | 5 | return width; |
770 | |
} |
771 | |
|
772 | |
public void setWidth(String width) { |
773 | 5 | this.width = width; |
774 | 5 | } |
775 | |
|
776 | |
|
777 | |
|
778 | |
|
779 | |
|
780 | |
protected void setProperties(UIComponent component) { |
781 | 33 | super.setProperties(component); |
782 | 33 | setComponentProperty(component, JsfConstants.ACCEPT_ATTR, accept); |
783 | 33 | setComponentProperty(component, JsfConstants.ACCEPTCHARSET_ATTR, |
784 | |
acceptcharset); |
785 | 33 | setComponentProperty(component, JsfConstants.ACCESSKEY_ATTR, accesskey); |
786 | |
|
787 | 33 | setComponentProperty(component, JsfConstants.ALT_ATTR, alt); |
788 | 33 | setComponentProperty(component, JsfConstants.BGCOLOR_ATTR, bgcolor); |
789 | 33 | setComponentProperty(component, JsfConstants.BORDER_ATTR, border); |
790 | 33 | setComponentProperty(component, JsfConstants.CELLPADDING_ATTR, |
791 | |
cellpadding); |
792 | 33 | setComponentProperty(component, JsfConstants.CELLSPACING_ATTR, |
793 | |
cellspacing); |
794 | 33 | setComponentProperty(component, JsfConstants.CHARSET_ATTR, charset); |
795 | 33 | setComponentProperty(component, JsfConstants.CHECKED_ATTR, checked); |
796 | 33 | setComponentProperty(component, JsfConstants.COLS_ATTR, cols); |
797 | 33 | if (component instanceof ValueHolder) { |
798 | 15 | setConverterProperty(component, converter); |
799 | |
} |
800 | 33 | setComponentProperty(component, JsfConstants.COORDS_ATTR, coords); |
801 | 33 | setComponentProperty(component, JsfConstants.DATE_STYLE_ATTR, dateStyle); |
802 | 33 | setComponentProperty(component, JsfConstants.DIR_ATTR, dir); |
803 | 33 | setComponentProperty(component, JsfConstants.DISABLED_ATTR, disabled); |
804 | 33 | setComponentProperty(component, JsfConstants.DISABLED_CLASS_ATTR, |
805 | |
disabledClass); |
806 | 33 | setComponentProperty(component, JsfConstants.ENABLED_CLASS_ATTR, |
807 | |
enabledClass); |
808 | 33 | setComponentProperty(component, JsfConstants.ENCTYPE_ATTR, enctype); |
809 | 33 | setComponentProperty(component, JsfConstants.FORMAT_PATTERN_ATTR, |
810 | |
formatPattern); |
811 | 33 | setComponentProperty(component, JsfConstants.FORMAT_STYLE_ATTR, |
812 | |
formatStyle); |
813 | 33 | setComponentProperty(component, JsfConstants.FRAME_ATTR, frame); |
814 | 33 | setComponentProperty(component, JsfConstants.HEIGHT_ATTR, height); |
815 | 33 | setComponentProperty(component, JsfConstants.HREF_ATTR, href); |
816 | 33 | setComponentProperty(component, JsfConstants.HREFLANG_ATTR, hreflang); |
817 | 33 | setComponentProperty(component, JsfConstants.HSPACE_ATTR, hspace); |
818 | 33 | setComponentProperty(component, JsfConstants.HTML_FOR_ATTR, htmlFor); |
819 | 33 | setComponentProperty(component, JsfConstants.ISMAP_ATTR, ismap); |
820 | 33 | setComponentProperty(component, JsfConstants.LANG_ATTR, lang); |
821 | 33 | setComponentProperty(component, JsfConstants.LONGDESC_ATTR, longdesc); |
822 | 33 | setComponentProperty(component, JsfConstants.MAXLENGTH_ATTR, maxlength); |
823 | 33 | setComponentProperty(component, JsfConstants.METHOD_ATTR, method); |
824 | 33 | setComponentProperty(component, JsfConstants.MULTIPLE_ATTR, multiple); |
825 | 33 | setComponentProperty(component, JsfConstants.NAME_ATTR, name); |
826 | |
|
827 | 33 | setComponentProperty(component, JsfConstants.ONBLUR_ATTR, onblur); |
828 | 33 | setComponentProperty(component, JsfConstants.ONCHANGE_ATTR, onchange); |
829 | 33 | setComponentProperty(component, JsfConstants.ONCLICK_ATTR, onclick); |
830 | 33 | setComponentProperty(component, JsfConstants.ONDBLCLICK_ATTR, |
831 | |
ondblclick); |
832 | 33 | setComponentProperty(component, JsfConstants.ONFOCUS_ATTR, onfocus); |
833 | 33 | setComponentProperty(component, JsfConstants.ONKEYDOWN_ATTR, onkeydown); |
834 | 33 | setComponentProperty(component, JsfConstants.ONKEYPRESS_ATTR, |
835 | |
onkeypress); |
836 | 33 | setComponentProperty(component, JsfConstants.ONKEYUP_ATTR, onkeyup); |
837 | 33 | setComponentProperty(component, JsfConstants.ONMOUSEDOWN_ATTR, |
838 | |
onmousedown); |
839 | 33 | setComponentProperty(component, JsfConstants.ONMOUSEMOVE_ATTR, |
840 | |
onmousemove); |
841 | 33 | setComponentProperty(component, JsfConstants.ONMOUSEOUT_ATTR, |
842 | |
onmouseout); |
843 | 33 | setComponentProperty(component, JsfConstants.ONMOUSEOVER_ATTR, |
844 | |
onmouseover); |
845 | 33 | setComponentProperty(component, JsfConstants.ONMOUSEUP_ATTR, onmouseup); |
846 | 33 | setComponentProperty(component, JsfConstants.ONRESET_ATTR, onreset); |
847 | 33 | setComponentProperty(component, JsfConstants.ONSELECT_ATTR, onselect); |
848 | 33 | setComponentProperty(component, JsfConstants.ONSUBMIT_ATTR, onsubmit); |
849 | 33 | setComponentProperty(component, JsfConstants.READONLY_ATTR, readonly); |
850 | 33 | setComponentProperty(component, JsfConstants.REL_ATTR, rel); |
851 | 33 | setComponentProperty(component, JsfConstants.REV_ATTR, rev); |
852 | 33 | setComponentProperty(component, JsfConstants.ROWS_ATTR, rows); |
853 | 33 | setComponentProperty(component, JsfConstants.RULES_ATTR, rules); |
854 | 33 | setComponentProperty(component, JsfConstants.SELECTED_ATTR, selected); |
855 | 33 | setComponentProperty(component, JsfConstants.SHAPE_ATTR, shape); |
856 | 33 | setComponentProperty(component, JsfConstants.SIZE_ATTR, size); |
857 | 33 | setComponentProperty(component, JsfConstants.SRC_ATTR, src); |
858 | 33 | setComponentProperty(component, JsfConstants.STYLE_ATTR, style); |
859 | 33 | setComponentProperty(component, JsfConstants.STYLE_CLASS_ATTR, |
860 | |
styleClass); |
861 | 33 | setComponentProperty(component, JsfConstants.SUMMARY_ATTR, summary); |
862 | 33 | setComponentProperty(component, JsfConstants.TABINDEX_ATTR, tabindex); |
863 | 33 | setComponentProperty(component, JsfConstants.TARGET_ATTR, target); |
864 | 33 | setComponentProperty(component, JsfConstants.TIME_STYLE_ATTR, timeStyle); |
865 | 33 | setComponentProperty(component, JsfConstants.TIMEZONE_ATTR, timezone); |
866 | 33 | setComponentProperty(component, JsfConstants.TITLE_ATTR, title); |
867 | 33 | setComponentProperty(component, JsfConstants.TYPE_ATTR, type); |
868 | 33 | setComponentProperty(component, JsfConstants.USEMAP_ATTR, usemap); |
869 | 33 | setComponentProperty(component, JsfConstants.VALUE_ATTR, value); |
870 | 33 | setComponentProperty(component, JsfConstants.WIDTH_ATTR, width); |
871 | 33 | } |
872 | |
|
873 | |
public void release() { |
874 | 16 | super.release(); |
875 | 16 | styleClass = null; |
876 | 16 | title = null; |
877 | 16 | enabledClass = null; |
878 | 16 | disabledClass = null; |
879 | 16 | onclick = null; |
880 | 16 | ondblclick = null; |
881 | 16 | onmousedown = null; |
882 | 16 | onmouseover = null; |
883 | 16 | onmousemove = null; |
884 | 16 | onmouseout = null; |
885 | 16 | onkeypress = null; |
886 | 16 | onkeydown = null; |
887 | 16 | onkeyup = null; |
888 | 16 | lang = null; |
889 | 16 | dir = null; |
890 | 16 | height = null; |
891 | 16 | width = null; |
892 | 16 | cellspacing = null; |
893 | 16 | cellpadding = null; |
894 | 16 | disabled = null; |
895 | 16 | size = null; |
896 | 16 | tabindex = null; |
897 | 16 | checked = null; |
898 | 16 | border = null; |
899 | 16 | readonly = null; |
900 | 16 | ismap = null; |
901 | 16 | maxlength = null; |
902 | 16 | rows = null; |
903 | 16 | cols = null; |
904 | 16 | formatStyle = null; |
905 | 16 | dateStyle = null; |
906 | 16 | timeStyle = null; |
907 | 16 | timezone = null; |
908 | 16 | formatPattern = null; |
909 | 16 | accept = null; |
910 | 16 | acceptcharset = null; |
911 | 16 | accesskey = null; |
912 | 16 | action = null; |
913 | 16 | alt = null; |
914 | 16 | charset = null; |
915 | 16 | coords = null; |
916 | 16 | enctype = null; |
917 | 16 | htmlFor = null; |
918 | 16 | href = null; |
919 | 16 | hreflang = null; |
920 | 16 | hspace = null; |
921 | 16 | longdesc = null; |
922 | 16 | method = null; |
923 | 16 | multiple = null; |
924 | 16 | name = null; |
925 | 16 | onblur = null; |
926 | 16 | onchange = null; |
927 | 16 | onfocus = null; |
928 | 16 | onmouseup = null; |
929 | 16 | onreset = null; |
930 | 16 | onselect = null; |
931 | 16 | onsubmit = null; |
932 | 16 | rel = null; |
933 | 16 | rev = null; |
934 | 16 | selected = null; |
935 | 16 | shape = null; |
936 | 16 | src = null; |
937 | 16 | style = null; |
938 | 16 | target = null; |
939 | 16 | type = null; |
940 | 16 | usemap = null; |
941 | 16 | value = null; |
942 | 16 | summary = null; |
943 | 16 | bgcolor = null; |
944 | 16 | frame = null; |
945 | 16 | rules = null; |
946 | 16 | converter = null; |
947 | 16 | } |
948 | |
|
949 | |
protected void setConverterProperty(UIComponent component, String value) { |
950 | 15 | if (value == null) { |
951 | 0 | return; |
952 | |
} |
953 | 15 | if (!(component instanceof ValueHolder)) { |
954 | 0 | throw new NoValueHolderRuntimeException(component.getClass()); |
955 | |
} |
956 | 15 | if (isValueReference(value)) { |
957 | 0 | BindingUtil.setValueBinding(component, JsfConstants.CONVERTER_ATTR, |
958 | |
value); |
959 | |
} else { |
960 | 15 | Converter converter = createConverter(value); |
961 | 15 | ((ValueHolder) component).setConverter(converter); |
962 | |
} |
963 | 15 | } |
964 | |
|
965 | |
protected void setValidatorProperty(UIComponent component, String value) { |
966 | 11 | if (value == null) { |
967 | 0 | return; |
968 | |
} |
969 | 11 | if (!(component instanceof EditableValueHolder)) { |
970 | 0 | throw new NoEditableValueHolderRuntimeException(component |
971 | |
.getClass()); |
972 | |
} |
973 | 11 | if (!isValueReference(value)) { |
974 | 0 | throw new NoValueReferenceRuntimeException(value); |
975 | |
} |
976 | 11 | MethodBinding mb = createMethodBinding(value, VALIDATOR_ARGTYPES); |
977 | 11 | ((EditableValueHolder) component).setValidator(mb); |
978 | 11 | } |
979 | |
|
980 | |
protected void setActionProperty(UIComponent component, String value) { |
981 | 7 | if (value == null) { |
982 | 3 | return; |
983 | |
} |
984 | 4 | if (!(component instanceof UICommand)) { |
985 | 0 | throw new NoUICommandRuntimeException(component.getClass()); |
986 | |
} |
987 | 4 | MethodBinding mb = null; |
988 | 4 | if (isValueReference(value)) { |
989 | 2 | mb = createMethodBinding(value, null); |
990 | |
} else { |
991 | 2 | mb = new SimpleMethodBinding(value); |
992 | |
} |
993 | 4 | ((UICommand) component).setAction(mb); |
994 | 4 | } |
995 | |
|
996 | |
protected void setActionListenerProperty(UIComponent component, String value) { |
997 | 7 | if (value == null) { |
998 | 4 | return; |
999 | |
} |
1000 | 3 | if (!(component instanceof UICommand)) { |
1001 | 0 | throw new NoUICommandRuntimeException(component.getClass()); |
1002 | |
} |
1003 | 3 | MethodBinding mb = null; |
1004 | 3 | if (!isValueReference(value)) { |
1005 | 1 | throw new NoValueReferenceRuntimeException(value); |
1006 | |
} |
1007 | 2 | mb = createMethodBinding(value, ACTION_LISTENER_ARGS); |
1008 | 2 | ((UICommand) component).setActionListener(mb); |
1009 | 2 | } |
1010 | |
|
1011 | |
protected void setValueChangeListenerProperty(UIComponent component, |
1012 | |
String value) { |
1013 | 11 | if (value == null) { |
1014 | 0 | return; |
1015 | |
} |
1016 | 11 | if (!(component instanceof EditableValueHolder)) { |
1017 | 0 | throw new NoEditableValueHolderRuntimeException(component |
1018 | |
.getClass()); |
1019 | |
} |
1020 | 11 | if (!isValueReference(value)) { |
1021 | 0 | throw new NoValueReferenceRuntimeException(value); |
1022 | |
} |
1023 | 11 | MethodBinding mb = createMethodBinding(value, VALUE_LISTENER_ARGS); |
1024 | 11 | ((EditableValueHolder) component).setValueChangeListener(mb); |
1025 | |
|
1026 | 11 | } |
1027 | |
|
1028 | |
protected Application getApplication() { |
1029 | 41 | return FacesContext.getCurrentInstance().getApplication(); |
1030 | |
} |
1031 | |
|
1032 | |
protected Converter createConverter(String value) { |
1033 | 15 | return getApplication().createConverter(value); |
1034 | |
} |
1035 | |
|
1036 | |
protected MethodBinding createMethodBinding(String value, Class[] argTypes) { |
1037 | 26 | return getApplication().createMethodBinding(value, argTypes); |
1038 | |
} |
1039 | |
|
1040 | |
} |