1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.myfaces.trinidad.component.html;
23
24 import java.util.Arrays;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29 import javax.faces.component.behavior.ClientBehavior;
30 import javax.faces.component.behavior.ClientBehaviorHolder;
31 import org.apache.myfaces.trinidad.bean.FacesBean;
32 import org.apache.myfaces.trinidad.bean.PropertyKey;
33 import org.apache.myfaces.trinidad.component.UIXComponentBase;
34 import org.apache.myfaces.trinidad.util.ComponentUtils;
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 public class HtmlCellFormat extends UIXComponentBase
58 implements ClientBehaviorHolder
59 {
60 static public final String HALIGN_RIGHT = "right";
61 static public final String HALIGN_START = "start";
62 static public final String HALIGN_LEFT = "left";
63 static public final String HALIGN_END = "end";
64 static public final String HALIGN_CENTER = "center";
65 static public final String VALIGN_MIDDLE = "middle";
66 static public final String VALIGN_TOP = "top";
67 static public final String VALIGN_BOTTOM = "bottom";
68 static public final FacesBean.Type TYPE = new FacesBean.Type(
69 UIXComponentBase.TYPE);
70 static public final PropertyKey SHORT_TEXT_KEY =
71 TYPE.registerKey("shortText", String.class);
72 static public final PropertyKey HALIGN_KEY =
73 TYPE.registerKey("halign", String.class);
74 static public final PropertyKey VALIGN_KEY =
75 TYPE.registerKey("valign", String.class);
76 static public final PropertyKey WIDTH_KEY =
77 TYPE.registerKey("width", String.class);
78 static public final PropertyKey HEIGHT_KEY =
79 TYPE.registerKey("height", String.class);
80 static public final PropertyKey COLUMN_SPAN_KEY =
81 TYPE.registerKey("columnSpan", Integer.class);
82 static public final PropertyKey ROW_SPAN_KEY =
83 TYPE.registerKey("rowSpan", Integer.class);
84 static public final PropertyKey WRAPPING_DISABLED_KEY =
85 TYPE.registerKey("wrappingDisabled", Boolean.class, Boolean.FALSE);
86 static public final PropertyKey HEADERS_KEY =
87 TYPE.registerKey("headers", String.class);
88 static public final PropertyKey HEADER_KEY =
89 TYPE.registerKey("header", Boolean.class);
90 static public final PropertyKey SHORT_DESC_KEY =
91 TYPE.registerKey("shortDesc", String.class);
92 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
93 TYPE.registerKey("partialTriggers", String[].class);
94 static public final PropertyKey ONCLICK_KEY =
95 TYPE.registerKey("onclick", String.class);
96 static public final PropertyKey ONDBLCLICK_KEY =
97 TYPE.registerKey("ondblclick", String.class);
98 static public final PropertyKey ONMOUSEDOWN_KEY =
99 TYPE.registerKey("onmousedown", String.class);
100 static public final PropertyKey ONMOUSEUP_KEY =
101 TYPE.registerKey("onmouseup", String.class);
102 static public final PropertyKey ONMOUSEOVER_KEY =
103 TYPE.registerKey("onmouseover", String.class);
104 static public final PropertyKey ONMOUSEMOVE_KEY =
105 TYPE.registerKey("onmousemove", String.class);
106 static public final PropertyKey ONMOUSEOUT_KEY =
107 TYPE.registerKey("onmouseout", String.class);
108 static public final PropertyKey ONKEYPRESS_KEY =
109 TYPE.registerKey("onkeypress", String.class);
110 static public final PropertyKey ONKEYDOWN_KEY =
111 TYPE.registerKey("onkeydown", String.class);
112 static public final PropertyKey ONKEYUP_KEY =
113 TYPE.registerKey("onkeyup", String.class);
114 static public final PropertyKey STYLE_CLASS_KEY =
115 TYPE.registerKey("styleClass", String.class);
116 static public final PropertyKey INLINE_STYLE_KEY =
117 TYPE.registerKey("inlineStyle", String.class);
118
119 static public final String COMPONENT_FAMILY =
120 "org.apache.myfaces.trinidad.CellFormat";
121 static public final String COMPONENT_TYPE =
122 "org.apache.myfaces.trinidad.HtmlCellFormat";
123
124 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
125 Arrays.asList(
126 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
127 "mouseout", "keypress", "keydown", "keyup"
128 ));
129
130
131
132
133 public HtmlCellFormat()
134 {
135 super("org.apache.myfaces.trinidad.CellFormat");
136 }
137
138
139
140
141
142
143
144
145
146
147 final public String getShortText()
148 {
149 return ComponentUtils.resolveString(getProperty(SHORT_TEXT_KEY));
150 }
151
152
153
154
155
156
157
158
159
160
161 final public void setShortText(String shortText)
162 {
163 setProperty(SHORT_TEXT_KEY, (shortText));
164 }
165
166
167
168
169
170
171
172 final public String getHalign()
173 {
174 return ComponentUtils.resolveString(getProperty(HALIGN_KEY));
175 }
176
177
178
179
180
181
182
183 final public void setHalign(String halign)
184 {
185 setProperty(HALIGN_KEY, (halign));
186 }
187
188
189
190
191
192
193
194 final public String getValign()
195 {
196 return ComponentUtils.resolveString(getProperty(VALIGN_KEY));
197 }
198
199
200
201
202
203
204
205 final public void setValign(String valign)
206 {
207 setProperty(VALIGN_KEY, (valign));
208 }
209
210
211
212
213
214
215 final public String getWidth()
216 {
217 return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
218 }
219
220
221
222
223
224
225 final public void setWidth(String width)
226 {
227 setProperty(WIDTH_KEY, (width));
228 }
229
230
231
232
233
234
235 final public String getHeight()
236 {
237 return ComponentUtils.resolveString(getProperty(HEIGHT_KEY));
238 }
239
240
241
242
243
244
245 final public void setHeight(String height)
246 {
247 setProperty(HEIGHT_KEY, (height));
248 }
249
250
251
252
253
254
255 final public int getColumnSpan()
256 {
257 return ComponentUtils.resolveInteger(getProperty(COLUMN_SPAN_KEY));
258 }
259
260
261
262
263
264
265 final public void setColumnSpan(int columnSpan)
266 {
267 setProperty(COLUMN_SPAN_KEY, Integer.valueOf(columnSpan));
268 }
269
270
271
272
273
274
275 final public int getRowSpan()
276 {
277 return ComponentUtils.resolveInteger(getProperty(ROW_SPAN_KEY));
278 }
279
280
281
282
283
284
285 final public void setRowSpan(int rowSpan)
286 {
287 setProperty(ROW_SPAN_KEY, Integer.valueOf(rowSpan));
288 }
289
290
291
292
293
294
295
296 final public boolean isWrappingDisabled()
297 {
298 return ComponentUtils.resolveBoolean(getProperty(WRAPPING_DISABLED_KEY), false);
299 }
300
301
302
303
304
305
306
307 final public void setWrappingDisabled(boolean wrappingDisabled)
308 {
309 setProperty(WRAPPING_DISABLED_KEY, wrappingDisabled ? Boolean.TRUE : Boolean.FALSE);
310 }
311
312
313
314
315
316
317
318
319
320
321 final public String getHeaders()
322 {
323 return ComponentUtils.resolveString(getProperty(HEADERS_KEY));
324 }
325
326
327
328
329
330
331
332
333
334
335 final public void setHeaders(String headers)
336 {
337 setProperty(HEADERS_KEY, (headers));
338 }
339
340
341
342
343
344
345
346 final public boolean isHeader()
347 {
348 return ComponentUtils.resolveBoolean(getProperty(HEADER_KEY));
349 }
350
351
352
353
354
355
356
357 final public void setHeader(boolean header)
358 {
359 setProperty(HEADER_KEY, header ? Boolean.TRUE : Boolean.FALSE);
360 }
361
362
363
364
365
366
367
368 final public String getShortDesc()
369 {
370 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
371 }
372
373
374
375
376
377
378
379 final public void setShortDesc(String shortDesc)
380 {
381 setProperty(SHORT_DESC_KEY, (shortDesc));
382 }
383
384
385
386
387
388
389
390
391
392 final public String[] getPartialTriggers()
393 {
394 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
395 }
396
397
398
399
400
401
402
403
404
405 final public void setPartialTriggers(String[] partialTriggers)
406 {
407 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
408 }
409
410
411
412
413
414
415 final public String getOnclick()
416 {
417 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
418 }
419
420
421
422
423
424
425 final public void setOnclick(String onclick)
426 {
427 setProperty(ONCLICK_KEY, (onclick));
428 }
429
430
431
432
433
434
435 final public String getOndblclick()
436 {
437 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
438 }
439
440
441
442
443
444
445 final public void setOndblclick(String ondblclick)
446 {
447 setProperty(ONDBLCLICK_KEY, (ondblclick));
448 }
449
450
451
452
453
454
455 final public String getOnmousedown()
456 {
457 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
458 }
459
460
461
462
463
464
465 final public void setOnmousedown(String onmousedown)
466 {
467 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
468 }
469
470
471
472
473
474
475 final public String getOnmouseup()
476 {
477 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
478 }
479
480
481
482
483
484
485 final public void setOnmouseup(String onmouseup)
486 {
487 setProperty(ONMOUSEUP_KEY, (onmouseup));
488 }
489
490
491
492
493
494
495 final public String getOnmouseover()
496 {
497 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
498 }
499
500
501
502
503
504
505 final public void setOnmouseover(String onmouseover)
506 {
507 setProperty(ONMOUSEOVER_KEY, (onmouseover));
508 }
509
510
511
512
513
514
515 final public String getOnmousemove()
516 {
517 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
518 }
519
520
521
522
523
524
525 final public void setOnmousemove(String onmousemove)
526 {
527 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
528 }
529
530
531
532
533
534
535 final public String getOnmouseout()
536 {
537 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
538 }
539
540
541
542
543
544
545 final public void setOnmouseout(String onmouseout)
546 {
547 setProperty(ONMOUSEOUT_KEY, (onmouseout));
548 }
549
550
551
552
553
554
555 final public String getOnkeypress()
556 {
557 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
558 }
559
560
561
562
563
564
565 final public void setOnkeypress(String onkeypress)
566 {
567 setProperty(ONKEYPRESS_KEY, (onkeypress));
568 }
569
570
571
572
573
574
575 final public String getOnkeydown()
576 {
577 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
578 }
579
580
581
582
583
584
585 final public void setOnkeydown(String onkeydown)
586 {
587 setProperty(ONKEYDOWN_KEY, (onkeydown));
588 }
589
590
591
592
593
594
595 final public String getOnkeyup()
596 {
597 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
598 }
599
600
601
602
603
604
605 final public void setOnkeyup(String onkeyup)
606 {
607 setProperty(ONKEYUP_KEY, (onkeyup));
608 }
609
610
611
612
613
614
615 final public String getStyleClass()
616 {
617 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
618 }
619
620
621
622
623
624
625 final public void setStyleClass(String styleClass)
626 {
627 setProperty(STYLE_CLASS_KEY, (styleClass));
628 }
629
630
631
632
633
634
635 final public String getInlineStyle()
636 {
637 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
638 }
639
640
641
642
643
644
645 final public void setInlineStyle(String inlineStyle)
646 {
647 setProperty(INLINE_STYLE_KEY, (inlineStyle));
648 }
649
650 @Override
651 public String getDefaultEventName()
652 {
653 return "click";
654 }
655
656 @Override
657 public Collection<String> getEventNames()
658 {
659 return _EVENT_NAMES;
660 }
661
662 @Override
663 public Map<String, List<ClientBehavior>> getClientBehaviors()
664 {
665 return super.getClientBehaviors();
666 }
667
668 @Override
669 public void addClientBehavior(
670 String eventName,
671 ClientBehavior behavior)
672 {
673 super.addClientBehavior(eventName, behavior);
674 }
675
676 @Override
677 public String getFamily()
678 {
679 return COMPONENT_FAMILY;
680 }
681
682 @Override
683 protected FacesBean.Type getBeanType()
684 {
685 return TYPE;
686 }
687
688
689
690
691 protected HtmlCellFormat(
692 String rendererType
693 )
694 {
695 super(rendererType);
696 }
697
698 static
699 {
700 TYPE.lockAndRegister("org.apache.myfaces.trinidad.CellFormat","org.apache.myfaces.trinidad.CellFormat");
701 }
702 }