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