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