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