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