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
58
59
60
61
62
63
64 public class HtmlTableLayout extends UIXComponentBase
65 implements ClientBehaviorHolder
66 {
67 static public final String HALIGN_RIGHT = "right";
68 static public final String HALIGN_START = "start";
69 static public final String HALIGN_LEFT = "left";
70 static public final String HALIGN_END = "end";
71 static public final String HALIGN_CENTER = "center";
72 static public final FacesBean.Type TYPE = new FacesBean.Type(
73 UIXComponentBase.TYPE);
74 static public final PropertyKey WIDTH_KEY =
75 TYPE.registerKey("width", String.class);
76 static public final PropertyKey HALIGN_KEY =
77 TYPE.registerKey("halign", String.class);
78 static public final PropertyKey CELL_SPACING_KEY =
79 TYPE.registerKey("cellSpacing", Integer.class);
80 static public final PropertyKey CELL_PADDING_KEY =
81 TYPE.registerKey("cellPadding", Integer.class);
82 static public final PropertyKey BORDER_WIDTH_KEY =
83 TYPE.registerKey("borderWidth", Integer.class);
84 static public final PropertyKey SUMMARY_KEY =
85 TYPE.registerKey("summary", String.class);
86 static public final PropertyKey SHORT_DESC_KEY =
87 TYPE.registerKey("shortDesc", String.class);
88 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
89 TYPE.registerKey("partialTriggers", String[].class);
90 static public final PropertyKey ONCLICK_KEY =
91 TYPE.registerKey("onclick", String.class);
92 static public final PropertyKey ONDBLCLICK_KEY =
93 TYPE.registerKey("ondblclick", String.class);
94 static public final PropertyKey ONMOUSEDOWN_KEY =
95 TYPE.registerKey("onmousedown", String.class);
96 static public final PropertyKey ONMOUSEUP_KEY =
97 TYPE.registerKey("onmouseup", String.class);
98 static public final PropertyKey ONMOUSEOVER_KEY =
99 TYPE.registerKey("onmouseover", String.class);
100 static public final PropertyKey ONMOUSEMOVE_KEY =
101 TYPE.registerKey("onmousemove", String.class);
102 static public final PropertyKey ONMOUSEOUT_KEY =
103 TYPE.registerKey("onmouseout", String.class);
104 static public final PropertyKey ONKEYPRESS_KEY =
105 TYPE.registerKey("onkeypress", String.class);
106 static public final PropertyKey ONKEYDOWN_KEY =
107 TYPE.registerKey("onkeydown", String.class);
108 static public final PropertyKey ONKEYUP_KEY =
109 TYPE.registerKey("onkeyup", String.class);
110 static public final PropertyKey STYLE_CLASS_KEY =
111 TYPE.registerKey("styleClass", String.class);
112 static public final PropertyKey INLINE_STYLE_KEY =
113 TYPE.registerKey("inlineStyle", String.class);
114
115 static public final String COMPONENT_FAMILY =
116 "org.apache.myfaces.trinidad.TableLayout";
117 static public final String COMPONENT_TYPE =
118 "org.apache.myfaces.trinidad.HtmlTableLayout";
119
120 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
121 Arrays.asList(
122 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
123 "mouseout", "keypress", "keydown", "keyup"
124 ));
125
126
127
128
129 public HtmlTableLayout()
130 {
131 super("org.apache.myfaces.trinidad.TableLayout");
132 }
133
134
135
136
137
138
139 final public String getWidth()
140 {
141 return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
142 }
143
144
145
146
147
148
149 final public void setWidth(String width)
150 {
151 setProperty(WIDTH_KEY, (width));
152 }
153
154
155
156
157
158
159 final public void setWidth(int width)
160 {
161 setProperty(WIDTH_KEY, Integer.valueOf(width));
162 }
163
164
165
166
167
168
169
170 final public String getHalign()
171 {
172 return ComponentUtils.resolveString(getProperty(HALIGN_KEY));
173 }
174
175
176
177
178
179
180
181 final public void setHalign(String halign)
182 {
183 setProperty(HALIGN_KEY, (halign));
184 }
185
186
187
188
189
190
191 final public int getCellSpacing()
192 {
193 return ComponentUtils.resolveInteger(getProperty(CELL_SPACING_KEY));
194 }
195
196
197
198
199
200
201 final public void setCellSpacing(int cellSpacing)
202 {
203 setProperty(CELL_SPACING_KEY, Integer.valueOf(cellSpacing));
204 }
205
206
207
208
209
210
211 final public int getCellPadding()
212 {
213 return ComponentUtils.resolveInteger(getProperty(CELL_PADDING_KEY));
214 }
215
216
217
218
219
220
221 final public void setCellPadding(int cellPadding)
222 {
223 setProperty(CELL_PADDING_KEY, Integer.valueOf(cellPadding));
224 }
225
226
227
228
229
230
231 final public int getBorderWidth()
232 {
233 return ComponentUtils.resolveInteger(getProperty(BORDER_WIDTH_KEY));
234 }
235
236
237
238
239
240
241 final public void setBorderWidth(int borderWidth)
242 {
243 setProperty(BORDER_WIDTH_KEY, Integer.valueOf(borderWidth));
244 }
245
246
247
248
249
250
251
252
253
254 final public String getSummary()
255 {
256 return ComponentUtils.resolveString(getProperty(SUMMARY_KEY));
257 }
258
259
260
261
262
263
264
265
266
267 final public void setSummary(String summary)
268 {
269 setProperty(SUMMARY_KEY, (summary));
270 }
271
272
273
274
275
276
277
278 final public String getShortDesc()
279 {
280 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
281 }
282
283
284
285
286
287
288
289 final public void setShortDesc(String shortDesc)
290 {
291 setProperty(SHORT_DESC_KEY, (shortDesc));
292 }
293
294
295
296
297
298
299
300
301
302 final public String[] getPartialTriggers()
303 {
304 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
305 }
306
307
308
309
310
311
312
313
314
315 final public void setPartialTriggers(String[] partialTriggers)
316 {
317 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
318 }
319
320
321
322
323
324
325 final public String getOnclick()
326 {
327 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
328 }
329
330
331
332
333
334
335 final public void setOnclick(String onclick)
336 {
337 setProperty(ONCLICK_KEY, (onclick));
338 }
339
340
341
342
343
344
345 final public String getOndblclick()
346 {
347 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
348 }
349
350
351
352
353
354
355 final public void setOndblclick(String ondblclick)
356 {
357 setProperty(ONDBLCLICK_KEY, (ondblclick));
358 }
359
360
361
362
363
364
365 final public String getOnmousedown()
366 {
367 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
368 }
369
370
371
372
373
374
375 final public void setOnmousedown(String onmousedown)
376 {
377 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
378 }
379
380
381
382
383
384
385 final public String getOnmouseup()
386 {
387 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
388 }
389
390
391
392
393
394
395 final public void setOnmouseup(String onmouseup)
396 {
397 setProperty(ONMOUSEUP_KEY, (onmouseup));
398 }
399
400
401
402
403
404
405 final public String getOnmouseover()
406 {
407 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
408 }
409
410
411
412
413
414
415 final public void setOnmouseover(String onmouseover)
416 {
417 setProperty(ONMOUSEOVER_KEY, (onmouseover));
418 }
419
420
421
422
423
424
425 final public String getOnmousemove()
426 {
427 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
428 }
429
430
431
432
433
434
435 final public void setOnmousemove(String onmousemove)
436 {
437 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
438 }
439
440
441
442
443
444
445 final public String getOnmouseout()
446 {
447 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
448 }
449
450
451
452
453
454
455 final public void setOnmouseout(String onmouseout)
456 {
457 setProperty(ONMOUSEOUT_KEY, (onmouseout));
458 }
459
460
461
462
463
464
465 final public String getOnkeypress()
466 {
467 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
468 }
469
470
471
472
473
474
475 final public void setOnkeypress(String onkeypress)
476 {
477 setProperty(ONKEYPRESS_KEY, (onkeypress));
478 }
479
480
481
482
483
484
485 final public String getOnkeydown()
486 {
487 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
488 }
489
490
491
492
493
494
495 final public void setOnkeydown(String onkeydown)
496 {
497 setProperty(ONKEYDOWN_KEY, (onkeydown));
498 }
499
500
501
502
503
504
505 final public String getOnkeyup()
506 {
507 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
508 }
509
510
511
512
513
514
515 final public void setOnkeyup(String onkeyup)
516 {
517 setProperty(ONKEYUP_KEY, (onkeyup));
518 }
519
520
521
522
523
524
525 final public String getStyleClass()
526 {
527 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
528 }
529
530
531
532
533
534
535 final public void setStyleClass(String styleClass)
536 {
537 setProperty(STYLE_CLASS_KEY, (styleClass));
538 }
539
540
541
542
543
544
545 final public String getInlineStyle()
546 {
547 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
548 }
549
550
551
552
553
554
555 final public void setInlineStyle(String inlineStyle)
556 {
557 setProperty(INLINE_STYLE_KEY, (inlineStyle));
558 }
559
560 @Override
561 public String getDefaultEventName()
562 {
563 return "click";
564 }
565
566 @Override
567 public Collection<String> getEventNames()
568 {
569 return _EVENT_NAMES;
570 }
571
572 @Override
573 public Map<String, List<ClientBehavior>> getClientBehaviors()
574 {
575 return super.getClientBehaviors();
576 }
577
578 @Override
579 public void addClientBehavior(
580 String eventName,
581 ClientBehavior behavior)
582 {
583 super.addClientBehavior(eventName, behavior);
584 }
585
586 @Override
587 public String getFamily()
588 {
589 return COMPONENT_FAMILY;
590 }
591
592 @Override
593 protected FacesBean.Type getBeanType()
594 {
595 return TYPE;
596 }
597
598
599
600
601 protected HtmlTableLayout(
602 String rendererType
603 )
604 {
605 super(rendererType);
606 }
607
608 static
609 {
610 TYPE.lockAndRegister("org.apache.myfaces.trinidad.TableLayout","org.apache.myfaces.trinidad.TableLayout");
611 }
612 }