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.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.UIXShowDetail;
34  import org.apache.myfaces.trinidad.util.ComponentUtils;
35  
36  /**
37   *
38   * <html:p>
39   *   The showDetailHeader provides a means of toggling the contents
40   *   under a header between being disclosed(shown) or undisclosed(hidden).
41   * </html:p>
42   * <html:p>
43   *   On mobile devices the showDetailHeader renders nothing itself,
44   *   but does render its children.
45   * </html:p>
46   * 
47   * <section name="Appearance">
48   *   <html:p>
49   *     If the &quot;disclosed&quot; property on the showDetailHeader is set
50   *     to false, the icon arrow will point sideways, and the children of
51   *     the showDetailHeader will not be rendered.  If the &quot;disclosed&quot;
52   *     property of the showDetailHeader is set to true, the icon arrow will
53   *     point down and the children of the showDetailHeader will be rendered.
54   *   </html:p>
55   * </section>
56   * <section name="Events">
57   *   <html:p>
58   *     Clicking on the icon of the showDetailHeader will deliver a
59   *     <code>DisclosureEvent</code> to the server.
60   *   </html:p>
61   * </section>
62   *
63   * <h4>Events:</h4>
64   * <table border="1" width="100%" cellpadding="3" summary="">
65   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
66   * <th align="left">Type</th>
67   * <th align="left">Phases</th>
68   * <th align="left">Description</th>
69   * </tr>
70   * <tr class="TableRowColor">
71   * <td valign="top"><code>org.apache.myfaces.trinidad.event.DisclosureEvent</code></td>
72   * <td valign="top" nowrap>Apply<br>Request<br>Values<br>Invoke<br>Application</td>
73   * <td valign="top">The disclosure event is delivered when a node is
74                         disclosed.</td>
75   * </tr>
76   * <tr class="TableRowColor">
77   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
78   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
79   * <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>
80   * </tr>
81   * </table>
82   */
83  public class CoreShowDetailHeader extends UIXShowDetail
84                                    implements ClientBehaviorHolder
85  {
86    static public final String MESSAGE_TYPE_INFO = "info";
87    static public final String MESSAGE_TYPE_CONFIRMATION = "confirmation";
88    static public final String MESSAGE_TYPE_WARNING = "warning";
89    static public final String MESSAGE_TYPE_NONE = "none";
90    static public final String MESSAGE_TYPE_ERROR = "error";
91    static public final FacesBean.Type TYPE = new FacesBean.Type(
92      UIXShowDetail.TYPE);
93    static public final PropertyKey INLINE_STYLE_KEY =
94      TYPE.registerKey("inlineStyle", String.class);
95    static public final PropertyKey STYLE_CLASS_KEY =
96      TYPE.registerKey("styleClass", String.class);
97    static public final PropertyKey SHORT_DESC_KEY =
98      TYPE.registerKey("shortDesc", String.class);
99    static public final PropertyKey PARTIAL_TRIGGERS_KEY =
100     TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
101   static public final PropertyKey ONCLICK_KEY =
102     TYPE.registerKey("onclick", String.class);
103   static public final PropertyKey ONDBLCLICK_KEY =
104     TYPE.registerKey("ondblclick", String.class);
105   static public final PropertyKey ONMOUSEDOWN_KEY =
106     TYPE.registerKey("onmousedown", String.class);
107   static public final PropertyKey ONMOUSEUP_KEY =
108     TYPE.registerKey("onmouseup", String.class);
109   static public final PropertyKey ONMOUSEOVER_KEY =
110     TYPE.registerKey("onmouseover", String.class);
111   static public final PropertyKey ONMOUSEMOVE_KEY =
112     TYPE.registerKey("onmousemove", String.class);
113   static public final PropertyKey ONMOUSEOUT_KEY =
114     TYPE.registerKey("onmouseout", String.class);
115   static public final PropertyKey ONKEYPRESS_KEY =
116     TYPE.registerKey("onkeypress", String.class);
117   static public final PropertyKey ONKEYDOWN_KEY =
118     TYPE.registerKey("onkeydown", String.class);
119   static public final PropertyKey ONKEYUP_KEY =
120     TYPE.registerKey("onkeyup", String.class);
121   static public final PropertyKey TEXT_KEY =
122     TYPE.registerKey("text", String.class);
123   static public final PropertyKey ICON_KEY =
124     TYPE.registerKey("icon", String.class);
125   static public final PropertyKey MESSAGE_TYPE_KEY =
126     TYPE.registerKey("messageType", String.class, "none");
127   static public final PropertyKey SIZE_KEY =
128     TYPE.registerKey("size", Integer.class, Integer.valueOf(-1));
129 
130   static public final String COMPONENT_FAMILY =
131     "org.apache.myfaces.trinidad.ShowDetail";
132   static public final String COMPONENT_TYPE =
133     "org.apache.myfaces.trinidad.CoreShowDetailHeader";
134   // Supported client events for client behaviors:
135   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
136     Arrays.asList(
137       "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
138       "mouseout", "keypress", "keydown", "keyup"
139     ));
140 
141   /**
142    * Construct an instance of the CoreShowDetailHeader.
143    */
144   public CoreShowDetailHeader()
145   {
146     super("org.apache.myfaces.trinidad.Header");
147   }
148 
149   /**
150    * Gets the CSS styles to use for this component.
151    *
152    * @return  the new inlineStyle value
153    */
154   final public String getInlineStyle()
155   {
156     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
157   }
158 
159   /**
160    * Sets the CSS styles to use for this component.
161    * 
162    * @param inlineStyle  the new inlineStyle value
163    */
164   final public void setInlineStyle(String inlineStyle)
165   {
166     setProperty(INLINE_STYLE_KEY, (inlineStyle));
167   }
168 
169   /**
170    * Gets a CSS style class to use for this component.
171    *
172    * @return  the new styleClass value
173    */
174   final public String getStyleClass()
175   {
176     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
177   }
178 
179   /**
180    * Sets a CSS style class to use for this component.
181    * 
182    * @param styleClass  the new styleClass value
183    */
184   final public void setStyleClass(String styleClass)
185   {
186     setProperty(STYLE_CLASS_KEY, (styleClass));
187   }
188 
189   /**
190    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
191    *
192    * @return  the new shortDesc value
193    */
194   final public String getShortDesc()
195   {
196     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
197   }
198 
199   /**
200    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
201    * 
202    * @param shortDesc  the new shortDesc value
203    */
204   final public void setShortDesc(String shortDesc)
205   {
206     setProperty(SHORT_DESC_KEY, (shortDesc));
207   }
208 
209   /**
210    * Gets the IDs of the components that should trigger a partial update.
211    *         <p>
212    *         This component will listen on the trigger components. If one of the
213    *         trigger components receives an event that will cause it to update
214    *         in some way, this component will request to be updated too.</p>
215    *         <p>
216    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
217    *         </p>
218    *         <p>
219    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
220    *         or use multiple colons to move up through the NamingContainer. For example,
221    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
222    *         ":::" will pop out of two naming containers, etc. The search for
223    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
224    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
225    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
226    *
227    * @return  the new partialTriggers value
228    */
229   final public String[] getPartialTriggers()
230   {
231     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
232   }
233 
234   /**
235    * Sets the IDs of the components that should trigger a partial update.
236    *         <p>
237    *         This component will listen on the trigger components. If one of the
238    *         trigger components receives an event that will cause it to update
239    *         in some way, this component will request to be updated too.</p>
240    *         <p>
241    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
242    *         </p>
243    *         <p>
244    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
245    *         or use multiple colons to move up through the NamingContainer. For example,
246    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
247    *         ":::" will pop out of two naming containers, etc. The search for
248    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
249    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
250    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
251    * 
252    * @param partialTriggers  the new partialTriggers value
253    */
254   final public void setPartialTriggers(String[] partialTriggers)
255   {
256     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
257   }
258 
259   /**
260    * Gets an onclick Javascript handler.
261    *
262    * @return  the new onclick value
263    */
264   final public String getOnclick()
265   {
266     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
267   }
268 
269   /**
270    * Sets an onclick Javascript handler.
271    * 
272    * @param onclick  the new onclick value
273    */
274   final public void setOnclick(String onclick)
275   {
276     setProperty(ONCLICK_KEY, (onclick));
277   }
278 
279   /**
280    * Gets an ondblclick Javascript handler.
281    *
282    * @return  the new ondblclick value
283    */
284   final public String getOndblclick()
285   {
286     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
287   }
288 
289   /**
290    * Sets an ondblclick Javascript handler.
291    * 
292    * @param ondblclick  the new ondblclick value
293    */
294   final public void setOndblclick(String ondblclick)
295   {
296     setProperty(ONDBLCLICK_KEY, (ondblclick));
297   }
298 
299   /**
300    * Gets an onmousedown Javascript handler.
301    *
302    * @return  the new onmousedown value
303    */
304   final public String getOnmousedown()
305   {
306     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
307   }
308 
309   /**
310    * Sets an onmousedown Javascript handler.
311    * 
312    * @param onmousedown  the new onmousedown value
313    */
314   final public void setOnmousedown(String onmousedown)
315   {
316     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
317   }
318 
319   /**
320    * Gets an onmouseup Javascript handler.
321    *
322    * @return  the new onmouseup value
323    */
324   final public String getOnmouseup()
325   {
326     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
327   }
328 
329   /**
330    * Sets an onmouseup Javascript handler.
331    * 
332    * @param onmouseup  the new onmouseup value
333    */
334   final public void setOnmouseup(String onmouseup)
335   {
336     setProperty(ONMOUSEUP_KEY, (onmouseup));
337   }
338 
339   /**
340    * Gets an onmouseover Javascript handler.
341    *
342    * @return  the new onmouseover value
343    */
344   final public String getOnmouseover()
345   {
346     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
347   }
348 
349   /**
350    * Sets an onmouseover Javascript handler.
351    * 
352    * @param onmouseover  the new onmouseover value
353    */
354   final public void setOnmouseover(String onmouseover)
355   {
356     setProperty(ONMOUSEOVER_KEY, (onmouseover));
357   }
358 
359   /**
360    * Gets an onmousemove Javascript handler.
361    *
362    * @return  the new onmousemove value
363    */
364   final public String getOnmousemove()
365   {
366     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
367   }
368 
369   /**
370    * Sets an onmousemove Javascript handler.
371    * 
372    * @param onmousemove  the new onmousemove value
373    */
374   final public void setOnmousemove(String onmousemove)
375   {
376     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
377   }
378 
379   /**
380    * Gets an onmouseout Javascript handler.
381    *
382    * @return  the new onmouseout value
383    */
384   final public String getOnmouseout()
385   {
386     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
387   }
388 
389   /**
390    * Sets an onmouseout Javascript handler.
391    * 
392    * @param onmouseout  the new onmouseout value
393    */
394   final public void setOnmouseout(String onmouseout)
395   {
396     setProperty(ONMOUSEOUT_KEY, (onmouseout));
397   }
398 
399   /**
400    * Gets an onkeypress Javascript handler.
401    *
402    * @return  the new onkeypress value
403    */
404   final public String getOnkeypress()
405   {
406     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
407   }
408 
409   /**
410    * Sets an onkeypress Javascript handler.
411    * 
412    * @param onkeypress  the new onkeypress value
413    */
414   final public void setOnkeypress(String onkeypress)
415   {
416     setProperty(ONKEYPRESS_KEY, (onkeypress));
417   }
418 
419   /**
420    * Gets an onkeydown Javascript handler.
421    *
422    * @return  the new onkeydown value
423    */
424   final public String getOnkeydown()
425   {
426     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
427   }
428 
429   /**
430    * Sets an onkeydown Javascript handler.
431    * 
432    * @param onkeydown  the new onkeydown value
433    */
434   final public void setOnkeydown(String onkeydown)
435   {
436     setProperty(ONKEYDOWN_KEY, (onkeydown));
437   }
438 
439   /**
440    * Gets an onkeyup Javascript handler.
441    *
442    * @return  the new onkeyup value
443    */
444   final public String getOnkeyup()
445   {
446     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
447   }
448 
449   /**
450    * Sets an onkeyup Javascript handler.
451    * 
452    * @param onkeyup  the new onkeyup value
453    */
454   final public void setOnkeyup(String onkeyup)
455   {
456     setProperty(ONKEYUP_KEY, (onkeyup));
457   }
458 
459   /**
460    * Gets the label of the header.
461    *
462    * @return  the new text value
463    */
464   final public String getText()
465   {
466     return ComponentUtils.resolveString(getProperty(TEXT_KEY));
467   }
468 
469   /**
470    * Sets the label of the header.
471    * 
472    * @param text  the new text value
473    */
474   final public void setText(String text)
475   {
476     setProperty(TEXT_KEY, (text));
477   }
478 
479   /**
480    * Gets the URI for the icon of the header.
481    *
482    * @return  the new icon value
483    */
484   final public String getIcon()
485   {
486     return ComponentUtils.resolveString(getProperty(ICON_KEY));
487   }
488 
489   /**
490    * Sets the URI for the icon of the header.
491    * 
492    * @param icon  the new icon value
493    */
494   final public void setIcon(String icon)
495   {
496     setProperty(ICON_KEY, (icon));
497   }
498 
499   /**
500    * Gets Set if an error, info, confirmation, or warning header is needed.
501    *
502    * @return  the new messageType value
503    */
504   final public String getMessageType()
505   {
506     return ComponentUtils.resolveString(getProperty(MESSAGE_TYPE_KEY), "none");
507   }
508 
509   /**
510    * Sets Set if an error, info, confirmation, or warning header is needed.
511    * 
512    * @param messageType  the new messageType value
513    */
514   final public void setMessageType(String messageType)
515   {
516     setProperty(MESSAGE_TYPE_KEY, (messageType));
517   }
518 
519   /**
520    * Gets Size of this panelHeader. The largest is 0 and corresponds to an H1 header
521    *         the smallest is 5 and corresponds to an H6 Header.  Note that this version of the tag will 
522    *         display all sizes above 2 the same as size 2. Setting the size to a negative number will
523    *         allow the header to be calculated according to its parent header.  The default value for 
524    *         this property is -1.
525    *
526    * @return  the new size value
527    */
528   final public int getSize()
529   {
530     return ComponentUtils.resolveInteger(getProperty(SIZE_KEY), -1);
531   }
532 
533   /**
534    * Sets Size of this panelHeader. The largest is 0 and corresponds to an H1 header
535    *         the smallest is 5 and corresponds to an H6 Header.  Note that this version of the tag will 
536    *         display all sizes above 2 the same as size 2. Setting the size to a negative number will
537    *         allow the header to be calculated according to its parent header.  The default value for 
538    *         this property is -1.
539    * 
540    * @param size  the new size value
541    */
542   final public void setSize(int size)
543   {
544     setProperty(SIZE_KEY, Integer.valueOf(size));
545   }
546 
547   @Override
548   public String getDefaultEventName()
549   {
550     return "click";
551   }
552 
553   @Override
554   public Collection<String> getEventNames()
555   {
556     return _EVENT_NAMES;
557   }
558 
559   @Override
560   public Map<String, List<ClientBehavior>> getClientBehaviors()
561   {
562     return super.getClientBehaviors();
563   }
564 
565   @Override
566   public void addClientBehavior(
567     String         eventName,
568     ClientBehavior behavior)
569   {
570     super.addClientBehavior(eventName, behavior);
571   }
572 
573   @Override
574   public String getFamily()
575   {
576     return COMPONENT_FAMILY;
577   }
578 
579   @Override
580   protected FacesBean.Type getBeanType()
581   {
582     return TYPE;
583   }
584 
585   /**
586    * Construct an instance of the CoreShowDetailHeader.
587    */
588   protected CoreShowDetailHeader(
589     String rendererType
590     )
591   {
592     super(rendererType);
593   }
594 
595   static
596   {
597     TYPE.lockAndRegister("org.apache.myfaces.trinidad.ShowDetail","org.apache.myfaces.trinidad.Header");
598   }
599 }