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