1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.component.iterator.IMenuIterator;
4 import org.rcfaces.core.internal.component.Properties;
5 import org.rcfaces.core.component.capability.IOverStyleClassCapability;
6 import org.rcfaces.core.component.capability.ILayoutManagerCapability;
7 import org.rcfaces.core.internal.capability.IAsyncRenderComponent;
8 import org.apache.commons.logging.LogFactory;
9 import org.rcfaces.core.component.AbstractBasicComponent;
10 import org.rcfaces.core.component.capability.ILoadEventCapability;
11 import org.rcfaces.core.component.capability.IBorderCapability;
12 import org.rcfaces.core.component.IMenuComponent;
13 import org.rcfaces.core.component.capability.IAsyncRenderModeCapability;
14 import org.rcfaces.core.internal.converter.AsyncDecodeModeConverter;
15 import org.apache.commons.logging.Log;
16 import java.util.Set;
17 import org.rcfaces.core.component.capability.IInitEventCapability;
18 import org.rcfaces.core.component.capability.IAsyncDecodeModeCapability;
19 import org.rcfaces.core.component.capability.ITypedComponentCapability;
20 import org.rcfaces.core.component.capability.IBackgroundImageCapability;
21 import java.lang.String;
22 import org.rcfaces.core.internal.tools.MenuTools;
23 import org.rcfaces.core.internal.converter.AsyncRenderModeConverter;
24 import org.rcfaces.core.component.capability.IMouseEventCapability;
25 import javax.el.ValueExpression;
26 import java.util.HashSet;
27 import org.rcfaces.core.internal.converter.LayoutManagerTypeConverter;
28 import java.util.Arrays;
29 import org.rcfaces.core.internal.capability.IVariableScopeCapability;
30 import org.rcfaces.core.component.capability.IMenuCapability;
31
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 public class BoxComponent extends AbstractBasicComponent implements
68 IBackgroundImageCapability,
69 IBorderCapability,
70 IMouseEventCapability,
71 IInitEventCapability,
72 ILoadEventCapability,
73 ILayoutManagerCapability,
74 IMenuCapability,
75 IAsyncRenderModeCapability,
76 IAsyncDecodeModeCapability,
77 IVariableScopeCapability,
78 ITypedComponentCapability,
79 IOverStyleClassCapability,
80 IAsyncRenderComponent {
81
82 private static final Log LOG = LogFactory.getLog(BoxComponent.class);
83
84 public static final String COMPONENT_TYPE="org.rcfaces.core.box";
85
86 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractBasicComponent.CAMELIA_ATTRIBUTES);
87 static {
88 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"backgroundImageVerticalRepeat","horizontalScroll","backgroundImageVerticalPosition","backgroundImageHorizontalRepeat","overStyleClass","type","asyncDecodeMode","backgroundImageHorizontalPosition","loadListener","asyncRenderMode","initListener","scopeSaveValue","scopeVar","mouseOverListener","verticalScroll","scopeValue","backgroundImageURL","border","mouseOutListener","layoutType"}));
89 }
90
91 public BoxComponent() {
92 setRendererType(COMPONENT_TYPE);
93 }
94
95 public BoxComponent(String componentId) {
96 this();
97 setId(componentId);
98 }
99
100 public void setAsyncRenderMode(String asyncRenderMode) {
101
102
103 setAsyncRenderMode(((Integer)AsyncRenderModeConverter.SINGLETON.getAsObject(null, this, asyncRenderMode)).intValue());
104
105 }
106
107 public void setAsyncDecodeMode(String asyncDecodeMode) {
108
109
110 setAsyncDecodeMode(((Integer)AsyncDecodeModeConverter.SINGLETON.getAsObject(null, this, asyncDecodeMode)).intValue());
111
112 }
113
114 public void setLayoutType(String type) {
115
116
117 setLayoutType(((Integer)LayoutManagerTypeConverter.SINGLETON.getAsObject(null, this, type)).intValue());
118
119 }
120
121 public java.lang.String getBackgroundImageHorizontalPosition() {
122 return getBackgroundImageHorizontalPosition(null);
123 }
124
125
126
127
128 public java.lang.String getBackgroundImageHorizontalPosition(javax.faces.context.FacesContext facesContext) {
129 return engine.getStringProperty(Properties.BACKGROUND_IMAGE_HORIZONTAL_POSITION, facesContext);
130 }
131
132
133
134
135
136 public final boolean isBackgroundImageHorizontalPositionSetted() {
137 return engine.isPropertySetted(Properties.BACKGROUND_IMAGE_HORIZONTAL_POSITION);
138 }
139
140 public void setBackgroundImageHorizontalPosition(java.lang.String backgroundImageHorizontalPosition) {
141 engine.setProperty(Properties.BACKGROUND_IMAGE_HORIZONTAL_POSITION, backgroundImageHorizontalPosition);
142 }
143
144 public boolean isBackgroundImageHorizontalRepeat() {
145 return isBackgroundImageHorizontalRepeat(null);
146 }
147
148
149
150
151 public boolean isBackgroundImageHorizontalRepeat(javax.faces.context.FacesContext facesContext) {
152 return engine.getBoolProperty(Properties.BACKGROUND_IMAGE_HORIZONTAL_REPEAT, false, facesContext);
153 }
154
155
156
157
158
159 public final boolean isBackgroundImageHorizontalRepeatSetted() {
160 return engine.isPropertySetted(Properties.BACKGROUND_IMAGE_HORIZONTAL_REPEAT);
161 }
162
163 public void setBackgroundImageHorizontalRepeat(boolean backgroundImageHorizontalRepeat) {
164 engine.setProperty(Properties.BACKGROUND_IMAGE_HORIZONTAL_REPEAT, backgroundImageHorizontalRepeat);
165 }
166
167 public java.lang.String getBackgroundImageURL() {
168 return getBackgroundImageURL(null);
169 }
170
171
172
173
174 public java.lang.String getBackgroundImageURL(javax.faces.context.FacesContext facesContext) {
175 return engine.getStringProperty(Properties.BACKGROUND_IMAGE_URL, facesContext);
176 }
177
178
179
180
181
182 public final boolean isBackgroundImageURLSetted() {
183 return engine.isPropertySetted(Properties.BACKGROUND_IMAGE_URL);
184 }
185
186 public void setBackgroundImageURL(java.lang.String backgroundImageURL) {
187 engine.setProperty(Properties.BACKGROUND_IMAGE_URL, backgroundImageURL);
188 }
189
190 public java.lang.String getBackgroundImageVerticalPosition() {
191 return getBackgroundImageVerticalPosition(null);
192 }
193
194
195
196
197 public java.lang.String getBackgroundImageVerticalPosition(javax.faces.context.FacesContext facesContext) {
198 return engine.getStringProperty(Properties.BACKGROUND_IMAGE_VERTICAL_POSITION, facesContext);
199 }
200
201
202
203
204
205 public final boolean isBackgroundImageVerticalPositionSetted() {
206 return engine.isPropertySetted(Properties.BACKGROUND_IMAGE_VERTICAL_POSITION);
207 }
208
209 public void setBackgroundImageVerticalPosition(java.lang.String backgroundImageVerticalPosition) {
210 engine.setProperty(Properties.BACKGROUND_IMAGE_VERTICAL_POSITION, backgroundImageVerticalPosition);
211 }
212
213 public boolean isBackgroundImageVerticalRepeat() {
214 return isBackgroundImageVerticalRepeat(null);
215 }
216
217
218
219
220 public boolean isBackgroundImageVerticalRepeat(javax.faces.context.FacesContext facesContext) {
221 return engine.getBoolProperty(Properties.BACKGROUND_IMAGE_VERTICAL_REPEAT, false, facesContext);
222 }
223
224
225
226
227
228 public final boolean isBackgroundImageVerticalRepeatSetted() {
229 return engine.isPropertySetted(Properties.BACKGROUND_IMAGE_VERTICAL_REPEAT);
230 }
231
232 public void setBackgroundImageVerticalRepeat(boolean backgroundImageVerticalRepeat) {
233 engine.setProperty(Properties.BACKGROUND_IMAGE_VERTICAL_REPEAT, backgroundImageVerticalRepeat);
234 }
235
236 public boolean isBorder() {
237 return isBorder(null);
238 }
239
240
241
242
243 public boolean isBorder(javax.faces.context.FacesContext facesContext) {
244 return engine.getBoolProperty(Properties.BORDER, true, facesContext);
245 }
246
247
248
249
250
251 public final boolean isBorderSetted() {
252 return engine.isPropertySetted(Properties.BORDER);
253 }
254
255 public void setBorder(boolean border) {
256 engine.setProperty(Properties.BORDER, border);
257 }
258
259 public final void addMouseOutListener(org.rcfaces.core.event.IMouseOutListener listener) {
260 addFacesListener(listener);
261 }
262
263 public final void removeMouseOutListener(org.rcfaces.core.event.IMouseOutListener listener) {
264 removeFacesListener(listener);
265 }
266
267 public final javax.faces.event.FacesListener [] listMouseOutListeners() {
268 return getFacesListeners(org.rcfaces.core.event.IMouseOutListener.class);
269 }
270
271 public final void addMouseOverListener(org.rcfaces.core.event.IMouseOverListener listener) {
272 addFacesListener(listener);
273 }
274
275 public final void removeMouseOverListener(org.rcfaces.core.event.IMouseOverListener listener) {
276 removeFacesListener(listener);
277 }
278
279 public final javax.faces.event.FacesListener [] listMouseOverListeners() {
280 return getFacesListeners(org.rcfaces.core.event.IMouseOverListener.class);
281 }
282
283 public final void addInitListener(org.rcfaces.core.event.IInitListener listener) {
284 addFacesListener(listener);
285 }
286
287 public final void removeInitListener(org.rcfaces.core.event.IInitListener listener) {
288 removeFacesListener(listener);
289 }
290
291 public final javax.faces.event.FacesListener [] listInitListeners() {
292 return getFacesListeners(org.rcfaces.core.event.IInitListener.class);
293 }
294
295 public final void addLoadListener(org.rcfaces.core.event.ILoadListener listener) {
296 addFacesListener(listener);
297 }
298
299 public final void removeLoadListener(org.rcfaces.core.event.ILoadListener listener) {
300 removeFacesListener(listener);
301 }
302
303 public final javax.faces.event.FacesListener [] listLoadListeners() {
304 return getFacesListeners(org.rcfaces.core.event.ILoadListener.class);
305 }
306
307 public int getLayoutType() {
308 return getLayoutType(null);
309 }
310
311
312
313
314 public int getLayoutType(javax.faces.context.FacesContext facesContext) {
315 return engine.getIntProperty(Properties.LAYOUT_TYPE,0, facesContext);
316 }
317
318
319
320
321
322 public final boolean isLayoutTypeSetted() {
323 return engine.isPropertySetted(Properties.LAYOUT_TYPE);
324 }
325
326 public void setLayoutType(int layoutType) {
327 engine.setProperty(Properties.LAYOUT_TYPE, layoutType);
328 }
329
330 public IMenuComponent getMenu() {
331
332
333 return MenuTools.getMenu(this);
334
335 }
336
337 public IMenuComponent getMenu(String menuId) {
338
339
340 return MenuTools.getMenu(this, menuId);
341
342 }
343
344 public IMenuIterator listMenus() {
345
346
347 return MenuTools.listMenus(this);
348
349 }
350
351 public int getAsyncRenderMode() {
352 return getAsyncRenderMode(null);
353 }
354
355
356
357
358 public int getAsyncRenderMode(javax.faces.context.FacesContext facesContext) {
359 return engine.getIntProperty(Properties.ASYNC_RENDER_MODE,0, facesContext);
360 }
361
362
363
364
365
366 public final boolean isAsyncRenderModeSetted() {
367 return engine.isPropertySetted(Properties.ASYNC_RENDER_MODE);
368 }
369
370 public void setAsyncRenderMode(int asyncRenderMode) {
371 engine.setProperty(Properties.ASYNC_RENDER_MODE, asyncRenderMode);
372 }
373
374 public int getAsyncDecodeMode() {
375 return getAsyncDecodeMode(null);
376 }
377
378
379
380
381 public int getAsyncDecodeMode(javax.faces.context.FacesContext facesContext) {
382 return engine.getIntProperty(Properties.ASYNC_DECODE_MODE,0, facesContext);
383 }
384
385
386
387
388
389 public final boolean isAsyncDecodeModeSetted() {
390 return engine.isPropertySetted(Properties.ASYNC_DECODE_MODE);
391 }
392
393 public void setAsyncDecodeMode(int asyncDecodeMode) {
394 engine.setProperty(Properties.ASYNC_DECODE_MODE, asyncDecodeMode);
395 }
396
397 public boolean isScopeSaveValue() {
398 return isScopeSaveValue(null);
399 }
400
401
402
403
404 public boolean isScopeSaveValue(javax.faces.context.FacesContext facesContext) {
405 return engine.getBoolProperty(Properties.SCOPE_SAVE_VALUE, false, facesContext);
406 }
407
408
409
410
411
412 public final boolean isScopeSaveValueSetted() {
413 return engine.isPropertySetted(Properties.SCOPE_SAVE_VALUE);
414 }
415
416 public void setScopeSaveValue(boolean scopeSaveValue) {
417 engine.setProperty(Properties.SCOPE_SAVE_VALUE, scopeSaveValue);
418 }
419
420 public java.lang.Object getScopeValue() {
421 return getScopeValue(null);
422 }
423
424
425
426
427 public java.lang.Object getScopeValue(javax.faces.context.FacesContext facesContext) {
428 return engine.getProperty(Properties.SCOPE_VALUE, facesContext);
429 }
430
431
432
433
434
435 public final boolean isScopeValueSetted() {
436 return engine.isPropertySetted(Properties.SCOPE_VALUE);
437 }
438
439 public void setScopeValue(java.lang.Object scopeValue) {
440 engine.setProperty(Properties.SCOPE_VALUE, scopeValue);
441 }
442
443 public java.lang.String getScopeVar() {
444 return getScopeVar(null);
445 }
446
447
448
449
450 public java.lang.String getScopeVar(javax.faces.context.FacesContext facesContext) {
451 return engine.getStringProperty(Properties.SCOPE_VAR, facesContext);
452 }
453
454
455
456
457
458 public final boolean isScopeVarSetted() {
459 return engine.isPropertySetted(Properties.SCOPE_VAR);
460 }
461
462 public void setScopeVar(java.lang.String scopeVar) {
463 engine.setProperty(Properties.SCOPE_VAR, scopeVar);
464 }
465
466 public java.lang.String getType() {
467 return getType(null);
468 }
469
470
471
472
473 public java.lang.String getType(javax.faces.context.FacesContext facesContext) {
474 return engine.getStringProperty(Properties.TYPE, facesContext);
475 }
476
477
478
479
480
481 public final boolean isTypeSetted() {
482 return engine.isPropertySetted(Properties.TYPE);
483 }
484
485 public void setType(java.lang.String type) {
486 engine.setProperty(Properties.TYPE, type);
487 }
488
489 public java.lang.String getOverStyleClass() {
490 return getOverStyleClass(null);
491 }
492
493
494
495
496 public java.lang.String getOverStyleClass(javax.faces.context.FacesContext facesContext) {
497 return engine.getStringProperty(Properties.OVER_STYLE_CLASS, facesContext);
498 }
499
500
501
502
503
504 public final boolean isOverStyleClassSetted() {
505 return engine.isPropertySetted(Properties.OVER_STYLE_CLASS);
506 }
507
508 public void setOverStyleClass(java.lang.String overStyleClass) {
509 engine.setProperty(Properties.OVER_STYLE_CLASS, overStyleClass);
510 }
511
512
513
514
515
516 public boolean isHorizontalScroll() {
517 return isHorizontalScroll(null);
518 }
519
520
521
522
523
524 public boolean isHorizontalScroll(javax.faces.context.FacesContext facesContext) {
525 return engine.getBoolProperty(Properties.HORIZONTAL_SCROLL, false, facesContext);
526 }
527
528
529
530
531
532 public void setHorizontalScroll(boolean horizontalScroll) {
533 engine.setProperty(Properties.HORIZONTAL_SCROLL, horizontalScroll);
534 }
535
536
537
538
539
540
541
542
543
544 public boolean isHorizontalScrollSetted() {
545 return engine.isPropertySetted(Properties.HORIZONTAL_SCROLL);
546 }
547
548
549
550
551
552 public boolean isVerticalScroll() {
553 return isVerticalScroll(null);
554 }
555
556
557
558
559
560 public boolean isVerticalScroll(javax.faces.context.FacesContext facesContext) {
561 return engine.getBoolProperty(Properties.VERTICAL_SCROLL, false, facesContext);
562 }
563
564
565
566
567
568 public void setVerticalScroll(boolean verticalScroll) {
569 engine.setProperty(Properties.VERTICAL_SCROLL, verticalScroll);
570 }
571
572
573
574
575
576
577
578
579
580 public boolean isVerticalScrollSetted() {
581 return engine.isPropertySetted(Properties.VERTICAL_SCROLL);
582 }
583
584 protected Set getCameliaFields() {
585 return CAMELIA_ATTRIBUTES;
586 }
587 }