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