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