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   * <html:p>
40   * The panelCaptionGroup is used to render a set of components, into a related and more
41   * managable grouping.  The group is surrounded by a border containing the group caption.
42   * </html:p>
43   * <html:p>
44   * The caption facet can be used to specify a complex caption (e.g. Icons, Links, etc.) for the
45   * content group.  For simple captions, the captionText attribute will suffice.
46   * </html:p>
47   *
48   * <h4>Events:</h4>
49   * <table border="1" width="100%" cellpadding="3" summary="">
50   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
51   * <th align="left">Type</th>
52   * <th align="left">Phases</th>
53   * <th align="left">Description</th>
54   * </tr>
55   * <tr class="TableRowColor">
56   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
57   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
58   * <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>
59   * </tr>
60   * </table>
61   */
62  public class CorePanelCaptionGroup extends UIXPanel
63                                     implements ClientBehaviorHolder
64  {
65    static public final FacesBean.Type TYPE = new FacesBean.Type(
66      UIXPanel.TYPE);
67    static public final PropertyKey INLINE_STYLE_KEY =
68      TYPE.registerKey("inlineStyle", String.class);
69    static public final PropertyKey STYLE_CLASS_KEY =
70      TYPE.registerKey("styleClass", String.class);
71    static public final PropertyKey SHORT_DESC_KEY =
72      TYPE.registerKey("shortDesc", String.class);
73    static public final PropertyKey PARTIAL_TRIGGERS_KEY =
74      TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
75    static public final PropertyKey ONCLICK_KEY =
76      TYPE.registerKey("onclick", String.class);
77    static public final PropertyKey ONDBLCLICK_KEY =
78      TYPE.registerKey("ondblclick", String.class);
79    static public final PropertyKey ONMOUSEDOWN_KEY =
80      TYPE.registerKey("onmousedown", String.class);
81    static public final PropertyKey ONMOUSEUP_KEY =
82      TYPE.registerKey("onmouseup", String.class);
83    static public final PropertyKey ONMOUSEOVER_KEY =
84      TYPE.registerKey("onmouseover", String.class);
85    static public final PropertyKey ONMOUSEMOVE_KEY =
86      TYPE.registerKey("onmousemove", String.class);
87    static public final PropertyKey ONMOUSEOUT_KEY =
88      TYPE.registerKey("onmouseout", String.class);
89    static public final PropertyKey ONKEYPRESS_KEY =
90      TYPE.registerKey("onkeypress", String.class);
91    static public final PropertyKey ONKEYDOWN_KEY =
92      TYPE.registerKey("onkeydown", String.class);
93    static public final PropertyKey ONKEYUP_KEY =
94      TYPE.registerKey("onkeyup", String.class);
95    static public final PropertyKey CAPTION_TEXT_KEY =
96      TYPE.registerKey("captionText", String.class);
97    static public final String CAPTION_FACET = "caption";
98  
99    static public final String COMPONENT_FAMILY =
100     "org.apache.myfaces.trinidad.Panel";
101   static public final String COMPONENT_TYPE =
102     "org.apache.myfaces.trinidad.CorePanelCaptionGroup";
103   // Supported client events for client behaviors:
104   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
105     Arrays.asList(
106       "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
107       "mouseout", "keypress", "keydown", "keyup"
108     ));
109 
110   /**
111    * Construct an instance of the CorePanelCaptionGroup.
112    */
113   public CorePanelCaptionGroup()
114   {
115     super("org.apache.myfaces.trinidad.PanelCaptionGroup");
116   }
117 
118   /**
119    * Content to be rendered as the caption for the group content.  The
120    *       facet takes precidence over the captionText attribute and can be used to specify more complex
121    *       or non-text captions (e.g. images).
122    */
123   final public UIComponent getCaption()
124   {
125     return getFacet(CAPTION_FACET);
126   }
127 
128   /**
129    * Content to be rendered as the caption for the group content.  The
130    *       facet takes precidence over the captionText attribute and can be used to specify more complex
131    *       or non-text captions (e.g. images).
132    */
133   @SuppressWarnings("unchecked")
134   final public void setCaption(UIComponent captionFacet)
135   {
136     getFacets().put(CAPTION_FACET, captionFacet);
137   }
138 
139   /**
140    * Gets the CSS styles to use for this component.
141    *
142    * @return  the new inlineStyle value
143    */
144   final public String getInlineStyle()
145   {
146     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
147   }
148 
149   /**
150    * Sets the CSS styles to use for this component.
151    * 
152    * @param inlineStyle  the new inlineStyle value
153    */
154   final public void setInlineStyle(String inlineStyle)
155   {
156     setProperty(INLINE_STYLE_KEY, (inlineStyle));
157   }
158 
159   /**
160    * Gets a CSS style class to use for this component.
161    *
162    * @return  the new styleClass value
163    */
164   final public String getStyleClass()
165   {
166     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
167   }
168 
169   /**
170    * Sets a CSS style class to use for this component.
171    * 
172    * @param styleClass  the new styleClass value
173    */
174   final public void setStyleClass(String styleClass)
175   {
176     setProperty(STYLE_CLASS_KEY, (styleClass));
177   }
178 
179   /**
180    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
181    *
182    * @return  the new shortDesc value
183    */
184   final public String getShortDesc()
185   {
186     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
187   }
188 
189   /**
190    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
191    * 
192    * @param shortDesc  the new shortDesc value
193    */
194   final public void setShortDesc(String shortDesc)
195   {
196     setProperty(SHORT_DESC_KEY, (shortDesc));
197   }
198 
199   /**
200    * Gets the IDs of the components that should trigger a partial update.
201    *         <p>
202    *         This component will listen on the trigger components. If one of the
203    *         trigger components receives an event that will cause it to update
204    *         in some way, this component will request to be updated too.</p>
205    *         <p>
206    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
207    *         </p>
208    *         <p>
209    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
210    *         or use multiple colons to move up through the NamingContainer. For example,
211    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
212    *         ":::" will pop out of two naming containers, etc. The search for
213    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
214    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
215    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
216    *
217    * @return  the new partialTriggers value
218    */
219   final public String[] getPartialTriggers()
220   {
221     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
222   }
223 
224   /**
225    * Sets the IDs of the components that should trigger a partial update.
226    *         <p>
227    *         This component will listen on the trigger components. If one of the
228    *         trigger components receives an event that will cause it to update
229    *         in some way, this component will request to be updated too.</p>
230    *         <p>
231    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
232    *         </p>
233    *         <p>
234    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
235    *         or use multiple colons to move up through the NamingContainer. For example,
236    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
237    *         ":::" will pop out of two naming containers, etc. The search for
238    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
239    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
240    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
241    * 
242    * @param partialTriggers  the new partialTriggers value
243    */
244   final public void setPartialTriggers(String[] partialTriggers)
245   {
246     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
247   }
248 
249   /**
250    * Gets an onclick Javascript handler.
251    *
252    * @return  the new onclick value
253    */
254   final public String getOnclick()
255   {
256     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
257   }
258 
259   /**
260    * Sets an onclick Javascript handler.
261    * 
262    * @param onclick  the new onclick value
263    */
264   final public void setOnclick(String onclick)
265   {
266     setProperty(ONCLICK_KEY, (onclick));
267   }
268 
269   /**
270    * Gets an ondblclick Javascript handler.
271    *
272    * @return  the new ondblclick value
273    */
274   final public String getOndblclick()
275   {
276     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
277   }
278 
279   /**
280    * Sets an ondblclick Javascript handler.
281    * 
282    * @param ondblclick  the new ondblclick value
283    */
284   final public void setOndblclick(String ondblclick)
285   {
286     setProperty(ONDBLCLICK_KEY, (ondblclick));
287   }
288 
289   /**
290    * Gets an onmousedown Javascript handler.
291    *
292    * @return  the new onmousedown value
293    */
294   final public String getOnmousedown()
295   {
296     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
297   }
298 
299   /**
300    * Sets an onmousedown Javascript handler.
301    * 
302    * @param onmousedown  the new onmousedown value
303    */
304   final public void setOnmousedown(String onmousedown)
305   {
306     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
307   }
308 
309   /**
310    * Gets an onmouseup Javascript handler.
311    *
312    * @return  the new onmouseup value
313    */
314   final public String getOnmouseup()
315   {
316     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
317   }
318 
319   /**
320    * Sets an onmouseup Javascript handler.
321    * 
322    * @param onmouseup  the new onmouseup value
323    */
324   final public void setOnmouseup(String onmouseup)
325   {
326     setProperty(ONMOUSEUP_KEY, (onmouseup));
327   }
328 
329   /**
330    * Gets an onmouseover Javascript handler.
331    *
332    * @return  the new onmouseover value
333    */
334   final public String getOnmouseover()
335   {
336     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
337   }
338 
339   /**
340    * Sets an onmouseover Javascript handler.
341    * 
342    * @param onmouseover  the new onmouseover value
343    */
344   final public void setOnmouseover(String onmouseover)
345   {
346     setProperty(ONMOUSEOVER_KEY, (onmouseover));
347   }
348 
349   /**
350    * Gets an onmousemove Javascript handler.
351    *
352    * @return  the new onmousemove value
353    */
354   final public String getOnmousemove()
355   {
356     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
357   }
358 
359   /**
360    * Sets an onmousemove Javascript handler.
361    * 
362    * @param onmousemove  the new onmousemove value
363    */
364   final public void setOnmousemove(String onmousemove)
365   {
366     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
367   }
368 
369   /**
370    * Gets an onmouseout Javascript handler.
371    *
372    * @return  the new onmouseout value
373    */
374   final public String getOnmouseout()
375   {
376     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
377   }
378 
379   /**
380    * Sets an onmouseout Javascript handler.
381    * 
382    * @param onmouseout  the new onmouseout value
383    */
384   final public void setOnmouseout(String onmouseout)
385   {
386     setProperty(ONMOUSEOUT_KEY, (onmouseout));
387   }
388 
389   /**
390    * Gets an onkeypress Javascript handler.
391    *
392    * @return  the new onkeypress value
393    */
394   final public String getOnkeypress()
395   {
396     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
397   }
398 
399   /**
400    * Sets an onkeypress Javascript handler.
401    * 
402    * @param onkeypress  the new onkeypress value
403    */
404   final public void setOnkeypress(String onkeypress)
405   {
406     setProperty(ONKEYPRESS_KEY, (onkeypress));
407   }
408 
409   /**
410    * Gets an onkeydown Javascript handler.
411    *
412    * @return  the new onkeydown value
413    */
414   final public String getOnkeydown()
415   {
416     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
417   }
418 
419   /**
420    * Sets an onkeydown Javascript handler.
421    * 
422    * @param onkeydown  the new onkeydown value
423    */
424   final public void setOnkeydown(String onkeydown)
425   {
426     setProperty(ONKEYDOWN_KEY, (onkeydown));
427   }
428 
429   /**
430    * Gets an onkeyup Javascript handler.
431    *
432    * @return  the new onkeyup value
433    */
434   final public String getOnkeyup()
435   {
436     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
437   }
438 
439   /**
440    * Sets an onkeyup Javascript handler.
441    * 
442    * @param onkeyup  the new onkeyup value
443    */
444   final public void setOnkeyup(String onkeyup)
445   {
446     setProperty(ONKEYUP_KEY, (onkeyup));
447   }
448 
449   /**
450    * Gets The text to be rendered as the caption for the group content.
451    *
452    * @return  the new captionText value
453    */
454   final public String getCaptionText()
455   {
456     return ComponentUtils.resolveString(getProperty(CAPTION_TEXT_KEY));
457   }
458 
459   /**
460    * Sets The text to be rendered as the caption for the group content.
461    * 
462    * @param captionText  the new captionText value
463    */
464   final public void setCaptionText(String captionText)
465   {
466     setProperty(CAPTION_TEXT_KEY, (captionText));
467   }
468 
469   @Override
470   public String getDefaultEventName()
471   {
472     return "click";
473   }
474 
475   @Override
476   public Collection<String> getEventNames()
477   {
478     return _EVENT_NAMES;
479   }
480 
481   @Override
482   public Map<String, List<ClientBehavior>> getClientBehaviors()
483   {
484     return super.getClientBehaviors();
485   }
486 
487   @Override
488   public void addClientBehavior(
489     String         eventName,
490     ClientBehavior behavior)
491   {
492     super.addClientBehavior(eventName, behavior);
493   }
494 
495   @Override
496   public String getFamily()
497   {
498     return COMPONENT_FAMILY;
499   }
500 
501   @Override
502   protected FacesBean.Type getBeanType()
503   {
504     return TYPE;
505   }
506 
507   /**
508    * Construct an instance of the CorePanelCaptionGroup.
509    */
510   protected CorePanelCaptionGroup(
511     String rendererType
512     )
513   {
514     super(rendererType);
515   }
516 
517   static
518   {
519     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Panel","org.apache.myfaces.trinidad.PanelCaptionGroup");
520   }
521 }