1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.internal.component.Properties;
4 import org.rcfaces.core.component.capability.IOverStyleClassCapability;
5 import org.rcfaces.core.internal.capability.IAsyncRenderComponent;
6 import org.rcfaces.core.component.capability.IRadioGroupCapability;
7 import org.apache.commons.logging.LogFactory;
8 import org.rcfaces.core.component.capability.IAccessKeyCapability;
9 import org.rcfaces.core.component.capability.ILoadEventCapability;
10 import org.rcfaces.core.component.capability.IBorderCapability;
11 import org.rcfaces.core.component.capability.IAsyncRenderModeCapability;
12 import org.rcfaces.core.component.capability.IReadOnlyCapability;
13 import org.rcfaces.core.component.capability.IExpandEventCapability;
14 import org.apache.commons.logging.Log;
15 import java.util.Set;
16 import org.rcfaces.core.component.capability.IFontCapability;
17 import org.rcfaces.core.component.capability.IFocusBlurEventCapability;
18 import org.rcfaces.core.component.capability.ISelectionEventCapability;
19 import java.lang.String;
20 import org.rcfaces.core.component.capability.ITabIndexCapability;
21 import org.rcfaces.core.internal.converter.AsyncRenderModeConverter;
22 import org.rcfaces.core.component.capability.ITextDirectionCapability;
23 import org.rcfaces.core.component.capability.IDisabledCapability;
24 import javax.el.ValueExpression;
25 import org.rcfaces.core.component.capability.ITextAlignmentCapability;
26 import java.util.HashSet;
27 import org.rcfaces.core.component.AbstractOutputComponent;
28 import org.rcfaces.core.component.capability.ICollapsableCapability;
29 import java.util.Arrays;
30 import org.rcfaces.core.internal.capability.IVariableScopeCapability;
31 import org.rcfaces.core.component.capability.ITextCapability;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86 public class ExpandBarComponent extends AbstractOutputComponent implements
87 IExpandEventCapability,
88 IAsyncRenderModeCapability,
89 IFontCapability,
90 IDisabledCapability,
91 IReadOnlyCapability,
92 ITextCapability,
93 ITextDirectionCapability,
94 ITextAlignmentCapability,
95 ICollapsableCapability,
96 IBorderCapability,
97 IAccessKeyCapability,
98 ITabIndexCapability,
99 IRadioGroupCapability,
100 IFocusBlurEventCapability,
101 ISelectionEventCapability,
102 ILoadEventCapability,
103 IVariableScopeCapability,
104 IOverStyleClassCapability,
105 IAsyncRenderComponent {
106
107 private static final Log LOG = LogFactory.getLog(ExpandBarComponent.class);
108
109 public static final String COMPONENT_TYPE="org.rcfaces.core.expandBar";
110
111 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractOutputComponent.CAMELIA_ATTRIBUTES);
112 static {
113 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"fontName","accessKey","groupName","blurListener","collapsedText","tabIndex","userExpandable","focusListener","overStyleClass","loadListener","selectionListener","collapseEffect","scopeValue","border","text","expandListener","fontBold","fontSize","asyncRenderMode","collapsed","textDirection","fontItalic","scopeSaveValue","readOnly","fontUnderline","scopeVar","textAlignment","disabled"}));
114 }
115 protected static final String CAMELIA_VALUE_ALIAS="text";
116
117 public ExpandBarComponent() {
118 setRendererType(COMPONENT_TYPE);
119 }
120
121 public ExpandBarComponent(String componentId) {
122 this();
123 setId(componentId);
124 }
125
126 public void setAsyncRenderMode(String asyncRenderMode) {
127
128
129 setAsyncRenderMode(((Integer)AsyncRenderModeConverter.SINGLETON.getAsObject(null, this, asyncRenderMode)).intValue());
130
131 }
132
133 public final void addExpandListener(org.rcfaces.core.event.IExpandListener listener) {
134 addFacesListener(listener);
135 }
136
137 public final void removeExpandListener(org.rcfaces.core.event.IExpandListener listener) {
138 removeFacesListener(listener);
139 }
140
141 public final javax.faces.event.FacesListener [] listExpandListeners() {
142 return getFacesListeners(org.rcfaces.core.event.IExpandListener.class);
143 }
144
145 public int getAsyncRenderMode() {
146 return getAsyncRenderMode(null);
147 }
148
149
150
151
152 public int getAsyncRenderMode(javax.faces.context.FacesContext facesContext) {
153 return engine.getIntProperty(Properties.ASYNC_RENDER_MODE,0, facesContext);
154 }
155
156
157
158
159
160 public final boolean isAsyncRenderModeSetted() {
161 return engine.isPropertySetted(Properties.ASYNC_RENDER_MODE);
162 }
163
164 public void setAsyncRenderMode(int asyncRenderMode) {
165 engine.setProperty(Properties.ASYNC_RENDER_MODE, asyncRenderMode);
166 }
167
168 public java.lang.Boolean getFontBold() {
169 return getFontBold(null);
170 }
171
172
173
174
175 public java.lang.Boolean getFontBold(javax.faces.context.FacesContext facesContext) {
176 return engine.getBooleanProperty(Properties.FONT_BOLD, facesContext);
177 }
178
179
180
181
182
183 public final boolean isFontBoldSetted() {
184 return engine.isPropertySetted(Properties.FONT_BOLD);
185 }
186
187 public void setFontBold(java.lang.Boolean fontBold) {
188 engine.setProperty(Properties.FONT_BOLD, fontBold);
189 }
190
191 public java.lang.Boolean getFontItalic() {
192 return getFontItalic(null);
193 }
194
195
196
197
198 public java.lang.Boolean getFontItalic(javax.faces.context.FacesContext facesContext) {
199 return engine.getBooleanProperty(Properties.FONT_ITALIC, facesContext);
200 }
201
202
203
204
205
206 public final boolean isFontItalicSetted() {
207 return engine.isPropertySetted(Properties.FONT_ITALIC);
208 }
209
210 public void setFontItalic(java.lang.Boolean fontItalic) {
211 engine.setProperty(Properties.FONT_ITALIC, fontItalic);
212 }
213
214 public java.lang.String getFontName() {
215 return getFontName(null);
216 }
217
218
219
220
221 public java.lang.String getFontName(javax.faces.context.FacesContext facesContext) {
222 return engine.getStringProperty(Properties.FONT_NAME, facesContext);
223 }
224
225
226
227
228
229 public final boolean isFontNameSetted() {
230 return engine.isPropertySetted(Properties.FONT_NAME);
231 }
232
233 public void setFontName(java.lang.String fontName) {
234 engine.setProperty(Properties.FONT_NAME, fontName);
235 }
236
237 public java.lang.String getFontSize() {
238 return getFontSize(null);
239 }
240
241
242
243
244 public java.lang.String getFontSize(javax.faces.context.FacesContext facesContext) {
245 return engine.getStringProperty(Properties.FONT_SIZE, facesContext);
246 }
247
248
249
250
251
252 public final boolean isFontSizeSetted() {
253 return engine.isPropertySetted(Properties.FONT_SIZE);
254 }
255
256 public void setFontSize(java.lang.String fontSize) {
257 engine.setProperty(Properties.FONT_SIZE, fontSize);
258 }
259
260 public java.lang.Boolean getFontUnderline() {
261 return getFontUnderline(null);
262 }
263
264
265
266
267 public java.lang.Boolean getFontUnderline(javax.faces.context.FacesContext facesContext) {
268 return engine.getBooleanProperty(Properties.FONT_UNDERLINE, facesContext);
269 }
270
271
272
273
274
275 public final boolean isFontUnderlineSetted() {
276 return engine.isPropertySetted(Properties.FONT_UNDERLINE);
277 }
278
279 public void setFontUnderline(java.lang.Boolean fontUnderline) {
280 engine.setProperty(Properties.FONT_UNDERLINE, fontUnderline);
281 }
282
283 public boolean isDisabled() {
284 return isDisabled(null);
285 }
286
287
288
289
290 public boolean isDisabled(javax.faces.context.FacesContext facesContext) {
291 return engine.getBoolProperty(Properties.DISABLED, false, facesContext);
292 }
293
294
295
296
297
298 public final boolean isDisabledSetted() {
299 return engine.isPropertySetted(Properties.DISABLED);
300 }
301
302 public void setDisabled(boolean disabled) {
303 engine.setProperty(Properties.DISABLED, disabled);
304 }
305
306 public boolean isReadOnly() {
307 return isReadOnly(null);
308 }
309
310
311
312
313 public boolean isReadOnly(javax.faces.context.FacesContext facesContext) {
314 return engine.getBoolProperty(Properties.READ_ONLY, false, facesContext);
315 }
316
317
318
319
320
321 public final boolean isReadOnlySetted() {
322 return engine.isPropertySetted(Properties.READ_ONLY);
323 }
324
325 public void setReadOnly(boolean readOnly) {
326 engine.setProperty(Properties.READ_ONLY, readOnly);
327 }
328
329 public java.lang.String getText() {
330 return getText(null);
331 }
332
333
334
335
336 public java.lang.String getText(javax.faces.context.FacesContext facesContext) {
337 return org.rcfaces.core.internal.tools.ValuesTools.valueToString(this, facesContext);
338 }
339
340
341
342
343
344 public final boolean isTextSetted() {
345 return engine.isPropertySetted(Properties.TEXT);
346 }
347
348 public void setText(java.lang.String text) {
349 setValue(text);
350 }
351
352 public int getTextDirection() {
353 return getTextDirection(null);
354 }
355
356
357
358
359 public int getTextDirection(javax.faces.context.FacesContext facesContext) {
360 return engine.getIntProperty(Properties.TEXT_DIRECTION,0, facesContext);
361 }
362
363
364
365
366
367 public final boolean isTextDirectionSetted() {
368 return engine.isPropertySetted(Properties.TEXT_DIRECTION);
369 }
370
371 public void setTextDirection(int textDirection) {
372 engine.setProperty(Properties.TEXT_DIRECTION, textDirection);
373 }
374
375 public java.lang.String getTextAlignment() {
376 return getTextAlignment(null);
377 }
378
379
380
381
382 public java.lang.String getTextAlignment(javax.faces.context.FacesContext facesContext) {
383 return engine.getStringProperty(Properties.TEXT_ALIGNMENT, facesContext);
384 }
385
386
387
388
389
390 public final boolean isTextAlignmentSetted() {
391 return engine.isPropertySetted(Properties.TEXT_ALIGNMENT);
392 }
393
394 public void setTextAlignment(java.lang.String textAlignment) {
395 engine.setProperty(Properties.TEXT_ALIGNMENT, textAlignment);
396 }
397
398 public boolean isCollapsed() {
399 return isCollapsed(null);
400 }
401
402
403
404
405 public boolean isCollapsed(javax.faces.context.FacesContext facesContext) {
406 return engine.getBoolProperty(Properties.COLLAPSED, false, facesContext);
407 }
408
409
410
411
412
413 public final boolean isCollapsedSetted() {
414 return engine.isPropertySetted(Properties.COLLAPSED);
415 }
416
417 public void setCollapsed(boolean collapsed) {
418 engine.setProperty(Properties.COLLAPSED, collapsed);
419 }
420
421 public boolean isBorder() {
422 return isBorder(null);
423 }
424
425
426
427
428 public boolean isBorder(javax.faces.context.FacesContext facesContext) {
429 return engine.getBoolProperty(Properties.BORDER, true, facesContext);
430 }
431
432
433
434
435
436 public final boolean isBorderSetted() {
437 return engine.isPropertySetted(Properties.BORDER);
438 }
439
440 public void setBorder(boolean border) {
441 engine.setProperty(Properties.BORDER, border);
442 }
443
444 public java.lang.String getAccessKey() {
445 return getAccessKey(null);
446 }
447
448
449
450
451 public java.lang.String getAccessKey(javax.faces.context.FacesContext facesContext) {
452 return engine.getStringProperty(Properties.ACCESS_KEY, facesContext);
453 }
454
455
456
457
458
459 public final boolean isAccessKeySetted() {
460 return engine.isPropertySetted(Properties.ACCESS_KEY);
461 }
462
463 public void setAccessKey(java.lang.String accessKey) {
464 engine.setProperty(Properties.ACCESS_KEY, accessKey);
465 }
466
467 public java.lang.Integer getTabIndex() {
468 return getTabIndex(null);
469 }
470
471
472
473
474 public java.lang.Integer getTabIndex(javax.faces.context.FacesContext facesContext) {
475 return engine.getIntegerProperty(Properties.TAB_INDEX, facesContext);
476 }
477
478
479
480
481
482 public final boolean isTabIndexSetted() {
483 return engine.isPropertySetted(Properties.TAB_INDEX);
484 }
485
486 public void setTabIndex(java.lang.Integer tabIndex) {
487 engine.setProperty(Properties.TAB_INDEX, tabIndex);
488 }
489
490 public java.lang.String getGroupName() {
491 return getGroupName(null);
492 }
493
494
495
496
497 public java.lang.String getGroupName(javax.faces.context.FacesContext facesContext) {
498 return engine.getStringProperty(Properties.GROUP_NAME, facesContext);
499 }
500
501
502
503
504
505 public final boolean isGroupNameSetted() {
506 return engine.isPropertySetted(Properties.GROUP_NAME);
507 }
508
509 public void setGroupName(java.lang.String groupName) {
510 engine.setProperty(Properties.GROUP_NAME, groupName);
511 }
512
513 public final void addBlurListener(org.rcfaces.core.event.IBlurListener listener) {
514 addFacesListener(listener);
515 }
516
517 public final void removeBlurListener(org.rcfaces.core.event.IBlurListener listener) {
518 removeFacesListener(listener);
519 }
520
521 public final javax.faces.event.FacesListener [] listBlurListeners() {
522 return getFacesListeners(org.rcfaces.core.event.IBlurListener.class);
523 }
524
525 public final void addFocusListener(org.rcfaces.core.event.IFocusListener listener) {
526 addFacesListener(listener);
527 }
528
529 public final void removeFocusListener(org.rcfaces.core.event.IFocusListener listener) {
530 removeFacesListener(listener);
531 }
532
533 public final javax.faces.event.FacesListener [] listFocusListeners() {
534 return getFacesListeners(org.rcfaces.core.event.IFocusListener.class);
535 }
536
537 public final void addSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
538 addFacesListener(listener);
539 }
540
541 public final void removeSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
542 removeFacesListener(listener);
543 }
544
545 public final javax.faces.event.FacesListener [] listSelectionListeners() {
546 return getFacesListeners(org.rcfaces.core.event.ISelectionListener.class);
547 }
548
549 public final void addLoadListener(org.rcfaces.core.event.ILoadListener listener) {
550 addFacesListener(listener);
551 }
552
553 public final void removeLoadListener(org.rcfaces.core.event.ILoadListener listener) {
554 removeFacesListener(listener);
555 }
556
557 public final javax.faces.event.FacesListener [] listLoadListeners() {
558 return getFacesListeners(org.rcfaces.core.event.ILoadListener.class);
559 }
560
561 public boolean isScopeSaveValue() {
562 return isScopeSaveValue(null);
563 }
564
565
566
567
568 public boolean isScopeSaveValue(javax.faces.context.FacesContext facesContext) {
569 return engine.getBoolProperty(Properties.SCOPE_SAVE_VALUE, false, facesContext);
570 }
571
572
573
574
575
576 public final boolean isScopeSaveValueSetted() {
577 return engine.isPropertySetted(Properties.SCOPE_SAVE_VALUE);
578 }
579
580 public void setScopeSaveValue(boolean scopeSaveValue) {
581 engine.setProperty(Properties.SCOPE_SAVE_VALUE, scopeSaveValue);
582 }
583
584 public java.lang.Object getScopeValue() {
585 return getScopeValue(null);
586 }
587
588
589
590
591 public java.lang.Object getScopeValue(javax.faces.context.FacesContext facesContext) {
592 return engine.getProperty(Properties.SCOPE_VALUE, facesContext);
593 }
594
595
596
597
598
599 public final boolean isScopeValueSetted() {
600 return engine.isPropertySetted(Properties.SCOPE_VALUE);
601 }
602
603 public void setScopeValue(java.lang.Object scopeValue) {
604 engine.setProperty(Properties.SCOPE_VALUE, scopeValue);
605 }
606
607 public java.lang.String getScopeVar() {
608 return getScopeVar(null);
609 }
610
611
612
613
614 public java.lang.String getScopeVar(javax.faces.context.FacesContext facesContext) {
615 return engine.getStringProperty(Properties.SCOPE_VAR, facesContext);
616 }
617
618
619
620
621
622 public final boolean isScopeVarSetted() {
623 return engine.isPropertySetted(Properties.SCOPE_VAR);
624 }
625
626 public void setScopeVar(java.lang.String scopeVar) {
627 engine.setProperty(Properties.SCOPE_VAR, scopeVar);
628 }
629
630 public java.lang.String getOverStyleClass() {
631 return getOverStyleClass(null);
632 }
633
634
635
636
637 public java.lang.String getOverStyleClass(javax.faces.context.FacesContext facesContext) {
638 return engine.getStringProperty(Properties.OVER_STYLE_CLASS, facesContext);
639 }
640
641
642
643
644
645 public final boolean isOverStyleClassSetted() {
646 return engine.isPropertySetted(Properties.OVER_STYLE_CLASS);
647 }
648
649 public void setOverStyleClass(java.lang.String overStyleClass) {
650 engine.setProperty(Properties.OVER_STYLE_CLASS, overStyleClass);
651 }
652
653
654
655
656
657 public String getCollapseEffect() {
658 return getCollapseEffect(null);
659 }
660
661
662
663
664
665 public String getCollapseEffect(javax.faces.context.FacesContext facesContext) {
666 return engine.getStringProperty(Properties.COLLAPSE_EFFECT, facesContext);
667 }
668
669
670
671
672
673 public void setCollapseEffect(String collapseEffect) {
674 engine.setProperty(Properties.COLLAPSE_EFFECT, collapseEffect);
675 }
676
677
678
679
680
681
682
683
684
685 public boolean isCollapseEffectSetted() {
686 return engine.isPropertySetted(Properties.COLLAPSE_EFFECT);
687 }
688
689
690
691
692
693 public String getCollapsedText() {
694 return getCollapsedText(null);
695 }
696
697
698
699
700
701 public String getCollapsedText(javax.faces.context.FacesContext facesContext) {
702 return engine.getStringProperty(Properties.COLLAPSED_TEXT, facesContext);
703 }
704
705
706
707
708
709 public void setCollapsedText(String collapsedText) {
710 engine.setProperty(Properties.COLLAPSED_TEXT, collapsedText);
711 }
712
713
714
715
716
717
718
719
720
721 public boolean isCollapsedTextSetted() {
722 return engine.isPropertySetted(Properties.COLLAPSED_TEXT);
723 }
724
725
726
727
728
729 public boolean isUserExpandable() {
730 return isUserExpandable(null);
731 }
732
733
734
735
736
737 public boolean isUserExpandable(javax.faces.context.FacesContext facesContext) {
738 return engine.getBoolProperty(Properties.USER_EXPANDABLE, true, facesContext);
739 }
740
741
742
743
744
745 public void setUserExpandable(boolean userExpandable) {
746 engine.setProperty(Properties.USER_EXPANDABLE, userExpandable);
747 }
748
749
750
751
752
753
754
755
756
757 public boolean isUserExpandableSetted() {
758 return engine.isPropertySetted(Properties.USER_EXPANDABLE);
759 }
760
761 protected Set getCameliaFields() {
762 return CAMELIA_ATTRIBUTES;
763 }
764
765 protected String getCameliaValueAlias() {
766 return CAMELIA_VALUE_ALIAS;
767 }
768 }