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.core.layout;
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.UIComponent;
30 import javax.faces.component.behavior.ClientBehavior;
31 import javax.faces.component.behavior.ClientBehaviorHolder;
32 import org.apache.myfaces.trinidad.bean.FacesBean;
33 import org.apache.myfaces.trinidad.bean.PropertyKey;
34 import org.apache.myfaces.trinidad.component.UIXPanel;
35 import org.apache.myfaces.trinidad.util.ComponentUtils;
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 public class CorePanelPageHeader extends UIXPanel
56 implements ClientBehaviorHolder
57 {
58 static public final String CHROME_TYPE_COMPACT = "compact";
59 static public final String CHROME_TYPE_EXPANDED = "expanded";
60 static public final FacesBean.Type TYPE = new FacesBean.Type(
61 UIXPanel.TYPE);
62 static public final PropertyKey CHROME_TYPE_KEY =
63 TYPE.registerKey("chromeType", String.class, "compact");
64 static public final PropertyKey INLINE_STYLE_KEY =
65 TYPE.registerKey("inlineStyle", String.class);
66 static public final PropertyKey STYLE_CLASS_KEY =
67 TYPE.registerKey("styleClass", String.class);
68 static public final PropertyKey SHORT_DESC_KEY =
69 TYPE.registerKey("shortDesc", String.class);
70 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
71 TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
72 static public final PropertyKey ONCLICK_KEY =
73 TYPE.registerKey("onclick", String.class);
74 static public final PropertyKey ONDBLCLICK_KEY =
75 TYPE.registerKey("ondblclick", String.class);
76 static public final PropertyKey ONMOUSEDOWN_KEY =
77 TYPE.registerKey("onmousedown", String.class);
78 static public final PropertyKey ONMOUSEUP_KEY =
79 TYPE.registerKey("onmouseup", String.class);
80 static public final PropertyKey ONMOUSEOVER_KEY =
81 TYPE.registerKey("onmouseover", String.class);
82 static public final PropertyKey ONMOUSEMOVE_KEY =
83 TYPE.registerKey("onmousemove", String.class);
84 static public final PropertyKey ONMOUSEOUT_KEY =
85 TYPE.registerKey("onmouseout", String.class);
86 static public final PropertyKey ONKEYPRESS_KEY =
87 TYPE.registerKey("onkeypress", String.class);
88 static public final PropertyKey ONKEYDOWN_KEY =
89 TYPE.registerKey("onkeydown", String.class);
90 static public final PropertyKey ONKEYUP_KEY =
91 TYPE.registerKey("onkeyup", String.class);
92 static public final String NAVIGATION1_FACET = "navigation1";
93 static public final String NAVIGATION2_FACET = "navigation2";
94 static public final String NAVIGATION_GLOBAL_FACET = "navigationGlobal";
95 static public final String MENU_SWITCH_FACET = "menuSwitch";
96 static public final String BRANDING_FACET = "branding";
97 static public final String BRANDING_APP_FACET = "brandingApp";
98 static public final String BRANDING_APP_CONTEXTUAL_FACET = "brandingAppContextual";
99 static public final String SEARCH_FACET = "search";
100
101 static public final String COMPONENT_FAMILY =
102 "org.apache.myfaces.trinidad.Panel";
103 static public final String COMPONENT_TYPE =
104 "org.apache.myfaces.trinidad.CorePanelPageHeader";
105
106 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
107 Arrays.asList(
108 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
109 "mouseout", "keypress", "keydown", "keyup"
110 ));
111
112
113
114
115 public CorePanelPageHeader()
116 {
117 super("org.apache.myfaces.trinidad.PageHeader");
118 }
119
120
121
122
123 final public UIComponent getNavigation1()
124 {
125 return getFacet(NAVIGATION1_FACET);
126 }
127
128
129
130
131 @SuppressWarnings("unchecked")
132 final public void setNavigation1(UIComponent navigation1Facet)
133 {
134 getFacets().put(NAVIGATION1_FACET, navigation1Facet);
135 }
136
137
138
139
140 final public UIComponent getNavigation2()
141 {
142 return getFacet(NAVIGATION2_FACET);
143 }
144
145
146
147
148 @SuppressWarnings("unchecked")
149 final public void setNavigation2(UIComponent navigation2Facet)
150 {
151 getFacets().put(NAVIGATION2_FACET, navigation2Facet);
152 }
153
154
155
156
157 final public UIComponent getNavigationGlobal()
158 {
159 return getFacet(NAVIGATION_GLOBAL_FACET);
160 }
161
162
163
164
165 @SuppressWarnings("unchecked")
166 final public void setNavigationGlobal(UIComponent navigationGlobalFacet)
167 {
168 getFacets().put(NAVIGATION_GLOBAL_FACET, navigationGlobalFacet);
169 }
170
171
172
173
174 final public UIComponent getMenuSwitch()
175 {
176 return getFacet(MENU_SWITCH_FACET);
177 }
178
179
180
181
182 @SuppressWarnings("unchecked")
183 final public void setMenuSwitch(UIComponent menuSwitchFacet)
184 {
185 getFacets().put(MENU_SWITCH_FACET, menuSwitchFacet);
186 }
187
188
189
190
191
192
193 final public UIComponent getBranding()
194 {
195 return getFacet(BRANDING_FACET);
196 }
197
198
199
200
201
202
203 @SuppressWarnings("unchecked")
204 final public void setBranding(UIComponent brandingFacet)
205 {
206 getFacets().put(BRANDING_FACET, brandingFacet);
207 }
208
209
210
211
212
213 final public UIComponent getBrandingApp()
214 {
215 return getFacet(BRANDING_APP_FACET);
216 }
217
218
219
220
221
222 @SuppressWarnings("unchecked")
223 final public void setBrandingApp(UIComponent brandingAppFacet)
224 {
225 getFacets().put(BRANDING_APP_FACET, brandingAppFacet);
226 }
227
228
229
230
231
232
233
234
235
236 final public UIComponent getBrandingAppContextual()
237 {
238 return getFacet(BRANDING_APP_CONTEXTUAL_FACET);
239 }
240
241
242
243
244
245
246
247
248
249 @SuppressWarnings("unchecked")
250 final public void setBrandingAppContextual(UIComponent brandingAppContextualFacet)
251 {
252 getFacets().put(BRANDING_APP_CONTEXTUAL_FACET, brandingAppContextualFacet);
253 }
254
255
256
257
258 final public UIComponent getSearch()
259 {
260 return getFacet(SEARCH_FACET);
261 }
262
263
264
265
266 @SuppressWarnings("unchecked")
267 final public void setSearch(UIComponent searchFacet)
268 {
269 getFacets().put(SEARCH_FACET, searchFacet);
270 }
271
272
273
274
275
276
277
278
279 final public String getChromeType()
280 {
281 return ComponentUtils.resolveString(getProperty(CHROME_TYPE_KEY), "compact");
282 }
283
284
285
286
287
288
289
290
291 final public void setChromeType(String chromeType)
292 {
293 setProperty(CHROME_TYPE_KEY, (chromeType));
294 }
295
296
297
298
299
300
301 final public String getInlineStyle()
302 {
303 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
304 }
305
306
307
308
309
310
311 final public void setInlineStyle(String inlineStyle)
312 {
313 setProperty(INLINE_STYLE_KEY, (inlineStyle));
314 }
315
316
317
318
319
320
321 final public String getStyleClass()
322 {
323 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
324 }
325
326
327
328
329
330
331 final public void setStyleClass(String styleClass)
332 {
333 setProperty(STYLE_CLASS_KEY, (styleClass));
334 }
335
336
337
338
339
340
341 final public String getShortDesc()
342 {
343 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
344 }
345
346
347
348
349
350
351 final public void setShortDesc(String shortDesc)
352 {
353 setProperty(SHORT_DESC_KEY, (shortDesc));
354 }
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376 final public String[] getPartialTriggers()
377 {
378 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
379 }
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 final public void setPartialTriggers(String[] partialTriggers)
402 {
403 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
404 }
405
406
407
408
409
410
411 final public String getOnclick()
412 {
413 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
414 }
415
416
417
418
419
420
421 final public void setOnclick(String onclick)
422 {
423 setProperty(ONCLICK_KEY, (onclick));
424 }
425
426
427
428
429
430
431 final public String getOndblclick()
432 {
433 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
434 }
435
436
437
438
439
440
441 final public void setOndblclick(String ondblclick)
442 {
443 setProperty(ONDBLCLICK_KEY, (ondblclick));
444 }
445
446
447
448
449
450
451 final public String getOnmousedown()
452 {
453 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
454 }
455
456
457
458
459
460
461 final public void setOnmousedown(String onmousedown)
462 {
463 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
464 }
465
466
467
468
469
470
471 final public String getOnmouseup()
472 {
473 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
474 }
475
476
477
478
479
480
481 final public void setOnmouseup(String onmouseup)
482 {
483 setProperty(ONMOUSEUP_KEY, (onmouseup));
484 }
485
486
487
488
489
490
491 final public String getOnmouseover()
492 {
493 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
494 }
495
496
497
498
499
500
501 final public void setOnmouseover(String onmouseover)
502 {
503 setProperty(ONMOUSEOVER_KEY, (onmouseover));
504 }
505
506
507
508
509
510
511 final public String getOnmousemove()
512 {
513 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
514 }
515
516
517
518
519
520
521 final public void setOnmousemove(String onmousemove)
522 {
523 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
524 }
525
526
527
528
529
530
531 final public String getOnmouseout()
532 {
533 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
534 }
535
536
537
538
539
540
541 final public void setOnmouseout(String onmouseout)
542 {
543 setProperty(ONMOUSEOUT_KEY, (onmouseout));
544 }
545
546
547
548
549
550
551 final public String getOnkeypress()
552 {
553 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
554 }
555
556
557
558
559
560
561 final public void setOnkeypress(String onkeypress)
562 {
563 setProperty(ONKEYPRESS_KEY, (onkeypress));
564 }
565
566
567
568
569
570
571 final public String getOnkeydown()
572 {
573 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
574 }
575
576
577
578
579
580
581 final public void setOnkeydown(String onkeydown)
582 {
583 setProperty(ONKEYDOWN_KEY, (onkeydown));
584 }
585
586
587
588
589
590
591 final public String getOnkeyup()
592 {
593 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
594 }
595
596
597
598
599
600
601 final public void setOnkeyup(String onkeyup)
602 {
603 setProperty(ONKEYUP_KEY, (onkeyup));
604 }
605
606 @Override
607 public String getDefaultEventName()
608 {
609 return "click";
610 }
611
612 @Override
613 public Collection<String> getEventNames()
614 {
615 return _EVENT_NAMES;
616 }
617
618 @Override
619 public Map<String, List<ClientBehavior>> getClientBehaviors()
620 {
621 return super.getClientBehaviors();
622 }
623
624 @Override
625 public void addClientBehavior(
626 String eventName,
627 ClientBehavior behavior)
628 {
629 super.addClientBehavior(eventName, behavior);
630 }
631
632 @Override
633 public String getFamily()
634 {
635 return COMPONENT_FAMILY;
636 }
637
638 @Override
639 protected FacesBean.Type getBeanType()
640 {
641 return TYPE;
642 }
643
644
645
646
647 protected CorePanelPageHeader(
648 String rendererType
649 )
650 {
651 super(rendererType);
652 }
653
654 static
655 {
656 TYPE.lockAndRegister("org.apache.myfaces.trinidad.Panel","org.apache.myfaces.trinidad.PageHeader");
657 }
658 }