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