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