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