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.UIXProcess;
34  import org.apache.myfaces.trinidad.util.ComponentUtils;
35  
36  /**
37   *
38   * ProcessChoiceBar is a UIXProcess component that renders a previous
39   *           button, a choice bar, and a next button.
40   *           <section name="Model">
41   *           The processChoiceBar takes a model of type
42   *           <html:code>org.apache.myfaces.trinidad.model.MenuModel</html:code>. The last node along the focusPath and its siblings are rendered.
43   *           <html:p>
44   *           MenuModel extends TreeModel, but it also knows how to go from the current viewId to the focus path. Notice that the menuModel has no special knowledge of page navigation and places no requirements on the nodes that go into the tree. The nodes in the tree are stamped out with the 'nodeStamp' facet, which should contain a commandNavigationItem component, which allows the default actionListener mechanism to be used for page navigation.
45   *           </html:p>
46   *           <html:p>
47   *           There are two common scenarios for processes, &quot;Plus One&quot; and &quot;Max Visited&quot; which are explained below.
48   *             <html:ul>
49   *               <html:li>&quot;Plus One&quot; - from the current step the user can navigate to any previous page and the next page. If the user is on the 5th step of a process and goes back to step 2, then the user can only navigate from step 2 to step 1 and step 3.
50   *               </html:li>
51   *               <html:li>&quot;Max Visited&quot; - the user can navigate to the max visited page. If the user is currently on the max visited page then the user can also navigate to the next page. If the user is on the 5th step of a process and goes back to step 2, then the user can navigate from step 2 to steps 1, 2, 3, 4, and 5.
52   *               </html:li>
53   *             </html:ul>
54   * 
55   *             The class <html:code>org.apache.myfaces.trinidad.model.ProcessMenuModel</html:code> and <html:code>org.apache.myfaces.trinidad.model.ProcessUtils</html:code> were created to support the &quot;Plus One&quot; and &quot;Max Visited&quot; scenarios. Please see the javadoc for these classes for more information.
56   *           </html:p>
57   *           <html:p>
58   *           On browsers that support disabled items in the drop down,
59   *           the unreachable items will look disabled, otherwise they will not be rendered.
60   *           </html:p>
61   * 
62   *           </section>
63   *
64   * <h4>Events:</h4>
65   * <table border="1" width="100%" cellpadding="3" summary="">
66   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
67   * <th align="left">Type</th>
68   * <th align="left">Phases</th>
69   * <th align="left">Description</th>
70   * </tr>
71   * <tr class="TableRowColor">
72   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
73   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
74   * <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>
75   * </tr>
76   * </table>
77   */
78  public class CoreProcessChoiceBar extends UIXProcess
79                                    implements ClientBehaviorHolder
80  {
81    static public final FacesBean.Type TYPE = new FacesBean.Type(
82      UIXProcess.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 
112   static public final String COMPONENT_FAMILY =
113     "org.apache.myfaces.trinidad.Process";
114   static public final String COMPONENT_TYPE =
115     "org.apache.myfaces.trinidad.CoreProcessChoiceBar";
116   // Supported client events for client behaviors:
117   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
118     Arrays.asList(
119       "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
120       "mouseout", "keypress", "keydown", "keyup"
121     ));
122 
123   /**
124    * Construct an instance of the CoreProcessChoiceBar.
125    */
126   public CoreProcessChoiceBar()
127   {
128     super("org.apache.myfaces.trinidad.ChoiceBar");
129   }
130 
131   /**
132    * Gets the CSS styles to use for this component.
133    *
134    * @return  the new inlineStyle value
135    */
136   final public String getInlineStyle()
137   {
138     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
139   }
140 
141   /**
142    * Sets the CSS styles to use for this component.
143    * 
144    * @param inlineStyle  the new inlineStyle value
145    */
146   final public void setInlineStyle(String inlineStyle)
147   {
148     setProperty(INLINE_STYLE_KEY, (inlineStyle));
149   }
150 
151   /**
152    * Gets a CSS style class to use for this component.
153    *
154    * @return  the new styleClass value
155    */
156   final public String getStyleClass()
157   {
158     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
159   }
160 
161   /**
162    * Sets a CSS style class to use for this component.
163    * 
164    * @param styleClass  the new styleClass value
165    */
166   final public void setStyleClass(String styleClass)
167   {
168     setProperty(STYLE_CLASS_KEY, (styleClass));
169   }
170 
171   /**
172    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
173    *
174    * @return  the new shortDesc value
175    */
176   final public String getShortDesc()
177   {
178     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
179   }
180 
181   /**
182    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
183    * 
184    * @param shortDesc  the new shortDesc value
185    */
186   final public void setShortDesc(String shortDesc)
187   {
188     setProperty(SHORT_DESC_KEY, (shortDesc));
189   }
190 
191   /**
192    * Gets the IDs of the components that should trigger a partial update.
193    *         <p>
194    *         This component will listen on the trigger components. If one of the
195    *         trigger components receives an event that will cause it to update
196    *         in some way, this component will request to be updated too.</p>
197    *         <p>
198    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
199    *         </p>
200    *         <p>
201    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
202    *         or use multiple colons to move up through the NamingContainer. For example,
203    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
204    *         ":::" will pop out of two naming containers, etc. The search for
205    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
206    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
207    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
208    *
209    * @return  the new partialTriggers value
210    */
211   final public String[] getPartialTriggers()
212   {
213     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
214   }
215 
216   /**
217    * Sets the IDs of the components that should trigger a partial update.
218    *         <p>
219    *         This component will listen on the trigger components. If one of the
220    *         trigger components receives an event that will cause it to update
221    *         in some way, this component will request to be updated too.</p>
222    *         <p>
223    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
224    *         </p>
225    *         <p>
226    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
227    *         or use multiple colons to move up through the NamingContainer. For example,
228    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
229    *         ":::" will pop out of two naming containers, etc. The search for
230    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
231    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
232    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
233    * 
234    * @param partialTriggers  the new partialTriggers value
235    */
236   final public void setPartialTriggers(String[] partialTriggers)
237   {
238     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
239   }
240 
241   /**
242    * Gets an onclick Javascript handler.
243    *
244    * @return  the new onclick value
245    */
246   final public String getOnclick()
247   {
248     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
249   }
250 
251   /**
252    * Sets an onclick Javascript handler.
253    * 
254    * @param onclick  the new onclick value
255    */
256   final public void setOnclick(String onclick)
257   {
258     setProperty(ONCLICK_KEY, (onclick));
259   }
260 
261   /**
262    * Gets an ondblclick Javascript handler.
263    *
264    * @return  the new ondblclick value
265    */
266   final public String getOndblclick()
267   {
268     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
269   }
270 
271   /**
272    * Sets an ondblclick Javascript handler.
273    * 
274    * @param ondblclick  the new ondblclick value
275    */
276   final public void setOndblclick(String ondblclick)
277   {
278     setProperty(ONDBLCLICK_KEY, (ondblclick));
279   }
280 
281   /**
282    * Gets an onmousedown Javascript handler.
283    *
284    * @return  the new onmousedown value
285    */
286   final public String getOnmousedown()
287   {
288     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
289   }
290 
291   /**
292    * Sets an onmousedown Javascript handler.
293    * 
294    * @param onmousedown  the new onmousedown value
295    */
296   final public void setOnmousedown(String onmousedown)
297   {
298     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
299   }
300 
301   /**
302    * Gets an onmouseup Javascript handler.
303    *
304    * @return  the new onmouseup value
305    */
306   final public String getOnmouseup()
307   {
308     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
309   }
310 
311   /**
312    * Sets an onmouseup Javascript handler.
313    * 
314    * @param onmouseup  the new onmouseup value
315    */
316   final public void setOnmouseup(String onmouseup)
317   {
318     setProperty(ONMOUSEUP_KEY, (onmouseup));
319   }
320 
321   /**
322    * Gets an onmouseover Javascript handler.
323    *
324    * @return  the new onmouseover value
325    */
326   final public String getOnmouseover()
327   {
328     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
329   }
330 
331   /**
332    * Sets an onmouseover Javascript handler.
333    * 
334    * @param onmouseover  the new onmouseover value
335    */
336   final public void setOnmouseover(String onmouseover)
337   {
338     setProperty(ONMOUSEOVER_KEY, (onmouseover));
339   }
340 
341   /**
342    * Gets an onmousemove Javascript handler.
343    *
344    * @return  the new onmousemove value
345    */
346   final public String getOnmousemove()
347   {
348     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
349   }
350 
351   /**
352    * Sets an onmousemove Javascript handler.
353    * 
354    * @param onmousemove  the new onmousemove value
355    */
356   final public void setOnmousemove(String onmousemove)
357   {
358     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
359   }
360 
361   /**
362    * Gets an onmouseout Javascript handler.
363    *
364    * @return  the new onmouseout value
365    */
366   final public String getOnmouseout()
367   {
368     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
369   }
370 
371   /**
372    * Sets an onmouseout Javascript handler.
373    * 
374    * @param onmouseout  the new onmouseout value
375    */
376   final public void setOnmouseout(String onmouseout)
377   {
378     setProperty(ONMOUSEOUT_KEY, (onmouseout));
379   }
380 
381   /**
382    * Gets an onkeypress Javascript handler.
383    *
384    * @return  the new onkeypress value
385    */
386   final public String getOnkeypress()
387   {
388     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
389   }
390 
391   /**
392    * Sets an onkeypress Javascript handler.
393    * 
394    * @param onkeypress  the new onkeypress value
395    */
396   final public void setOnkeypress(String onkeypress)
397   {
398     setProperty(ONKEYPRESS_KEY, (onkeypress));
399   }
400 
401   /**
402    * Gets an onkeydown Javascript handler.
403    *
404    * @return  the new onkeydown value
405    */
406   final public String getOnkeydown()
407   {
408     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
409   }
410 
411   /**
412    * Sets an onkeydown Javascript handler.
413    * 
414    * @param onkeydown  the new onkeydown value
415    */
416   final public void setOnkeydown(String onkeydown)
417   {
418     setProperty(ONKEYDOWN_KEY, (onkeydown));
419   }
420 
421   /**
422    * Gets an onkeyup Javascript handler.
423    *
424    * @return  the new onkeyup value
425    */
426   final public String getOnkeyup()
427   {
428     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
429   }
430 
431   /**
432    * Sets an onkeyup Javascript handler.
433    * 
434    * @param onkeyup  the new onkeyup value
435    */
436   final public void setOnkeyup(String onkeyup)
437   {
438     setProperty(ONKEYUP_KEY, (onkeyup));
439   }
440 
441   @Override
442   public String getDefaultEventName()
443   {
444     return "click";
445   }
446 
447   @Override
448   public Collection<String> getEventNames()
449   {
450     return _EVENT_NAMES;
451   }
452 
453   @Override
454   public Map<String, List<ClientBehavior>> getClientBehaviors()
455   {
456     return super.getClientBehaviors();
457   }
458 
459   @Override
460   public void addClientBehavior(
461     String         eventName,
462     ClientBehavior behavior)
463   {
464     super.addClientBehavior(eventName, behavior);
465   }
466 
467   @Override
468   public String getFamily()
469   {
470     return COMPONENT_FAMILY;
471   }
472 
473   @Override
474   protected FacesBean.Type getBeanType()
475   {
476     return TYPE;
477   }
478 
479   /**
480    * Construct an instance of the CoreProcessChoiceBar.
481    */
482   protected CoreProcessChoiceBar(
483     String rendererType
484     )
485   {
486     super(rendererType);
487   }
488 
489   static
490   {
491     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Process","org.apache.myfaces.trinidad.ChoiceBar");
492   }
493 }