View Javadoc

1   // WARNING: This file was automatically generated. Do not edit it directly,
2   //          or you will lose your changes.
3   
4   /*
5    * Licensed to the Apache Software Foundation (ASF) under one
6    * or more contributor license agreements.  See the NOTICE file
7    * distributed with this work for additional information
8    * regarding copyright ownership.  The ASF licenses this file
9    * to you under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License.  You may obtain a copy of the License at
12   *
13   *   http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on an
17   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied.  See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
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   * PanelPageHeader lays out the top portion of a page.
40   *
41   * <h4>Events:</h4>
42   * <table border="1" width="100%" cellpadding="3" summary="">
43   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
44   * <th align="left">Type</th>
45   * <th align="left">Phases</th>
46   * <th align="left">Description</th>
47   * </tr>
48   * <tr class="TableRowColor">
49   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
50   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
51   * <td valign="top">Event delivered to describe an attribute change.  Attribute change events are not delivered for any programmatic change to a property.  They are only delivered when a renderer changes a property without the application's specific request.  An example of an attribute change event might include the width of a column that supported client-side resizing.</td>
52   * </tr>
53   * </table>
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   // Supported client events for client behaviors:
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    * Construct an instance of the CorePanelPageHeader.
114    */
115   public CorePanelPageHeader()
116   {
117     super("org.apache.myfaces.trinidad.PageHeader");
118   }
119 
120   /**
121    * This location typically contains a menuTabs.
122    */
123   final public UIComponent getNavigation1()
124   {
125     return getFacet(NAVIGATION1_FACET);
126   }
127 
128   /**
129    * This location typically contains a menuTabs.
130    */
131   @SuppressWarnings("unchecked")
132   final public void setNavigation1(UIComponent navigation1Facet)
133   {
134     getFacets().put(NAVIGATION1_FACET, navigation1Facet);
135   }
136 
137   /**
138    * This location typically contains a menuBar.
139    */
140   final public UIComponent getNavigation2()
141   {
142     return getFacet(NAVIGATION2_FACET);
143   }
144 
145   /**
146    * This location typically contains a menuBar.
147    */
148   @SuppressWarnings("unchecked")
149   final public void setNavigation2(UIComponent navigation2Facet)
150   {
151     getFacets().put(NAVIGATION2_FACET, navigation2Facet);
152   }
153 
154   /**
155    * This section typically contains a menuButtons.
156    */
157   final public UIComponent getNavigationGlobal()
158   {
159     return getFacet(NAVIGATION_GLOBAL_FACET);
160   }
161 
162   /**
163    * This section typically contains a menuButtons.
164    */
165   @SuppressWarnings("unchecked")
166   final public void setNavigationGlobal(UIComponent navigationGlobalFacet)
167   {
168     getFacets().put(NAVIGATION_GLOBAL_FACET, navigationGlobalFacet);
169   }
170 
171   /**
172    * This location typically contains a menuChoice.
173    */
174   final public UIComponent getMenuSwitch()
175   {
176     return getFacet(MENU_SWITCH_FACET);
177   }
178 
179   /**
180    * This location typically contains a menuChoice.
181    */
182   @SuppressWarnings("unchecked")
183   final public void setMenuSwitch(UIComponent menuSwitchFacet)
184   {
185     getFacets().put(MENU_SWITCH_FACET, menuSwitchFacet);
186   }
187 
188   /**
189    * The corporate or organization branding region of the page.  This section typically
190    *                 contains a medium size image of the logo of the organization
191    *                 owning the page.
192    */
193   final public UIComponent getBranding()
194   {
195     return getFacet(BRANDING_FACET);
196   }
197 
198   /**
199    * The corporate or organization branding region of the page.  This section typically
200    *                 contains a medium size image of the logo of the organization
201    *                 owning the page.
202    */
203   @SuppressWarnings("unchecked")
204   final public void setBranding(UIComponent brandingFacet)
205   {
206     getFacets().put(BRANDING_FACET, brandingFacet);
207   }
208 
209   /**
210    * The application, module, or product branding region of the page.
211    *                 This section typically contains a image of the application logo.
212    */
213   final public UIComponent getBrandingApp()
214   {
215     return getFacet(BRANDING_APP_FACET);
216   }
217 
218   /**
219    * The application, module, or product branding region of the page.
220    *                 This section typically contains a image of the application logo.
221    */
222   @SuppressWarnings("unchecked")
223   final public void setBrandingApp(UIComponent brandingAppFacet)
224   {
225     getFacets().put(BRANDING_APP_FACET, brandingAppFacet);
226   }
227 
228   /**
229    * The application's contextual branding region of the page.  This section typically
230    *                 contains formatted text indicating that ONE context exists
231    *                 between the persistent tabs. The user selects the context
232    *                 from a centralized aggregate home page of multiple contexts,
233    *                 then navigates into a tabbed application pertaining to that
234    *                 specific context.
235    */
236   final public UIComponent getBrandingAppContextual()
237   {
238     return getFacet(BRANDING_APP_CONTEXTUAL_FACET);
239   }
240 
241   /**
242    * The application's contextual branding region of the page.  This section typically
243    *                 contains formatted text indicating that ONE context exists
244    *                 between the persistent tabs. The user selects the context
245    *                 from a centralized aggregate home page of multiple contexts,
246    *                 then navigates into a tabbed application pertaining to that
247    *                 specific context.
248    */
249   @SuppressWarnings("unchecked")
250   final public void setBrandingAppContextual(UIComponent brandingAppContextualFacet)
251   {
252     getFacets().put(BRANDING_APP_CONTEXTUAL_FACET, brandingAppContextualFacet);
253   }
254 
255   /**
256    * The search region of the page.
257    */
258   final public UIComponent getSearch()
259   {
260     return getFacet(SEARCH_FACET);
261   }
262 
263   /**
264    * The search region of the page.
265    */
266   @SuppressWarnings("unchecked")
267   final public void setSearch(UIComponent searchFacet)
268   {
269     getFacets().put(SEARCH_FACET, searchFacet);
270   }
271 
272   /**
273    * Gets what the chromeType is for the page: compact or expanded. If
274    *               compact, the productBranding will be shown alongside the
275    *               corporate branding instead of below the corporate branding.
276    *
277    * @return  the new chromeType value
278    */
279   final public String getChromeType()
280   {
281     return ComponentUtils.resolveString(getProperty(CHROME_TYPE_KEY), "compact");
282   }
283 
284   /**
285    * Sets what the chromeType is for the page: compact or expanded. If
286    *               compact, the productBranding will be shown alongside the
287    *               corporate branding instead of below the corporate branding.
288    * 
289    * @param chromeType  the new chromeType value
290    */
291   final public void setChromeType(String chromeType)
292   {
293     setProperty(CHROME_TYPE_KEY, (chromeType));
294   }
295 
296   /**
297    * Gets the CSS styles to use for this component.
298    *
299    * @return  the new inlineStyle value
300    */
301   final public String getInlineStyle()
302   {
303     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
304   }
305 
306   /**
307    * Sets the CSS styles to use for this component.
308    * 
309    * @param inlineStyle  the new inlineStyle value
310    */
311   final public void setInlineStyle(String inlineStyle)
312   {
313     setProperty(INLINE_STYLE_KEY, (inlineStyle));
314   }
315 
316   /**
317    * Gets a CSS style class to use for this component.
318    *
319    * @return  the new styleClass value
320    */
321   final public String getStyleClass()
322   {
323     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
324   }
325 
326   /**
327    * Sets a CSS style class to use for this component.
328    * 
329    * @param styleClass  the new styleClass value
330    */
331   final public void setStyleClass(String styleClass)
332   {
333     setProperty(STYLE_CLASS_KEY, (styleClass));
334   }
335 
336   /**
337    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
338    *
339    * @return  the new shortDesc value
340    */
341   final public String getShortDesc()
342   {
343     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
344   }
345 
346   /**
347    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
348    * 
349    * @param shortDesc  the new shortDesc value
350    */
351   final public void setShortDesc(String shortDesc)
352   {
353     setProperty(SHORT_DESC_KEY, (shortDesc));
354   }
355 
356   /**
357    * Gets the IDs of the components that should trigger a partial update.
358    *         <p>
359    *         This component will listen on the trigger components. If one of the
360    *         trigger components receives an event that will cause it to update
361    *         in some way, this component will request to be updated too.</p>
362    *         <p>
363    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
364    *         </p>
365    *         <p>
366    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
367    *         or use multiple colons to move up through the NamingContainer. For example,
368    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
369    *         ":::" will pop out of two naming containers, etc. The search for
370    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
371    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
372    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
373    *
374    * @return  the new partialTriggers value
375    */
376   final public String[] getPartialTriggers()
377   {
378     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
379   }
380 
381   /**
382    * Sets the IDs of the components that should trigger a partial update.
383    *         <p>
384    *         This component will listen on the trigger components. If one of the
385    *         trigger components receives an event that will cause it to update
386    *         in some way, this component will request to be updated too.</p>
387    *         <p>
388    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
389    *         </p>
390    *         <p>
391    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
392    *         or use multiple colons to move up through the NamingContainer. For example,
393    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
394    *         ":::" will pop out of two naming containers, etc. The search for
395    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
396    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
397    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
398    * 
399    * @param partialTriggers  the new partialTriggers value
400    */
401   final public void setPartialTriggers(String[] partialTriggers)
402   {
403     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
404   }
405 
406   /**
407    * Gets an onclick Javascript handler.
408    *
409    * @return  the new onclick value
410    */
411   final public String getOnclick()
412   {
413     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
414   }
415 
416   /**
417    * Sets an onclick Javascript handler.
418    * 
419    * @param onclick  the new onclick value
420    */
421   final public void setOnclick(String onclick)
422   {
423     setProperty(ONCLICK_KEY, (onclick));
424   }
425 
426   /**
427    * Gets an ondblclick Javascript handler.
428    *
429    * @return  the new ondblclick value
430    */
431   final public String getOndblclick()
432   {
433     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
434   }
435 
436   /**
437    * Sets an ondblclick Javascript handler.
438    * 
439    * @param ondblclick  the new ondblclick value
440    */
441   final public void setOndblclick(String ondblclick)
442   {
443     setProperty(ONDBLCLICK_KEY, (ondblclick));
444   }
445 
446   /**
447    * Gets an onmousedown Javascript handler.
448    *
449    * @return  the new onmousedown value
450    */
451   final public String getOnmousedown()
452   {
453     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
454   }
455 
456   /**
457    * Sets an onmousedown Javascript handler.
458    * 
459    * @param onmousedown  the new onmousedown value
460    */
461   final public void setOnmousedown(String onmousedown)
462   {
463     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
464   }
465 
466   /**
467    * Gets an onmouseup Javascript handler.
468    *
469    * @return  the new onmouseup value
470    */
471   final public String getOnmouseup()
472   {
473     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
474   }
475 
476   /**
477    * Sets an onmouseup Javascript handler.
478    * 
479    * @param onmouseup  the new onmouseup value
480    */
481   final public void setOnmouseup(String onmouseup)
482   {
483     setProperty(ONMOUSEUP_KEY, (onmouseup));
484   }
485 
486   /**
487    * Gets an onmouseover Javascript handler.
488    *
489    * @return  the new onmouseover value
490    */
491   final public String getOnmouseover()
492   {
493     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
494   }
495 
496   /**
497    * Sets an onmouseover Javascript handler.
498    * 
499    * @param onmouseover  the new onmouseover value
500    */
501   final public void setOnmouseover(String onmouseover)
502   {
503     setProperty(ONMOUSEOVER_KEY, (onmouseover));
504   }
505 
506   /**
507    * Gets an onmousemove Javascript handler.
508    *
509    * @return  the new onmousemove value
510    */
511   final public String getOnmousemove()
512   {
513     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
514   }
515 
516   /**
517    * Sets an onmousemove Javascript handler.
518    * 
519    * @param onmousemove  the new onmousemove value
520    */
521   final public void setOnmousemove(String onmousemove)
522   {
523     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
524   }
525 
526   /**
527    * Gets an onmouseout Javascript handler.
528    *
529    * @return  the new onmouseout value
530    */
531   final public String getOnmouseout()
532   {
533     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
534   }
535 
536   /**
537    * Sets an onmouseout Javascript handler.
538    * 
539    * @param onmouseout  the new onmouseout value
540    */
541   final public void setOnmouseout(String onmouseout)
542   {
543     setProperty(ONMOUSEOUT_KEY, (onmouseout));
544   }
545 
546   /**
547    * Gets an onkeypress Javascript handler.
548    *
549    * @return  the new onkeypress value
550    */
551   final public String getOnkeypress()
552   {
553     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
554   }
555 
556   /**
557    * Sets an onkeypress Javascript handler.
558    * 
559    * @param onkeypress  the new onkeypress value
560    */
561   final public void setOnkeypress(String onkeypress)
562   {
563     setProperty(ONKEYPRESS_KEY, (onkeypress));
564   }
565 
566   /**
567    * Gets an onkeydown Javascript handler.
568    *
569    * @return  the new onkeydown value
570    */
571   final public String getOnkeydown()
572   {
573     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
574   }
575 
576   /**
577    * Sets an onkeydown Javascript handler.
578    * 
579    * @param onkeydown  the new onkeydown value
580    */
581   final public void setOnkeydown(String onkeydown)
582   {
583     setProperty(ONKEYDOWN_KEY, (onkeydown));
584   }
585 
586   /**
587    * Gets an onkeyup Javascript handler.
588    *
589    * @return  the new onkeyup value
590    */
591   final public String getOnkeyup()
592   {
593     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
594   }
595 
596   /**
597    * Sets an onkeyup Javascript handler.
598    * 
599    * @param onkeyup  the new onkeyup value
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    * Construct an instance of the CorePanelPageHeader.
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 }