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