View Javadoc

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.UIXGo;
34  import org.apache.myfaces.trinidad.util.ComponentUtils;
35  
36  /**
37   *
38   * <html:p>
39   *           The goLink component wraps its children inside
40   *           of an HTML link.  It is used on its own for general linking, but
41   *           can also be used as the content for menu components that support
42   *           linking when a server-side command (e.g., CommandLink)
43   *           is not desired.
44   *           </html:p>
45   *
46   * <h4>Events:</h4>
47   * <table border="1" width="100%" cellpadding="3" summary="">
48   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
49   * <th align="left">Type</th>
50   * <th align="left">Phases</th>
51   * <th align="left">Description</th>
52   * </tr>
53   * <tr class="TableRowColor">
54   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
55   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
56   * <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>
57   * </tr>
58   * </table>
59   */
60  public class CoreGoLink extends UIXGo
61                          implements ClientBehaviorHolder
62  {
63    static public final FacesBean.Type TYPE = new FacesBean.Type(
64      UIXGo.TYPE);
65    static public final PropertyKey TEXT_KEY =
66      TYPE.registerKey("text", String.class);
67    static public final PropertyKey DISABLED_KEY =
68      TYPE.registerKey("disabled", Boolean.class, Boolean.FALSE);
69    static public final PropertyKey ACCESS_KEY_KEY =
70      TYPE.registerKey("accessKey", Character.class);
71    static public final PropertyKey TARGET_FRAME_KEY =
72      TYPE.registerKey("targetFrame", String.class);
73    static public final PropertyKey INLINE_STYLE_KEY =
74      TYPE.registerKey("inlineStyle", String.class);
75    static public final PropertyKey STYLE_CLASS_KEY =
76      TYPE.registerKey("styleClass", String.class);
77    static public final PropertyKey SHORT_DESC_KEY =
78      TYPE.registerKey("shortDesc", String.class);
79    static public final PropertyKey PARTIAL_TRIGGERS_KEY =
80      TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
81    static public final PropertyKey ONCLICK_KEY =
82      TYPE.registerKey("onclick", String.class);
83    static public final PropertyKey ONDBLCLICK_KEY =
84      TYPE.registerKey("ondblclick", String.class);
85    static public final PropertyKey ONMOUSEDOWN_KEY =
86      TYPE.registerKey("onmousedown", String.class);
87    static public final PropertyKey ONMOUSEUP_KEY =
88      TYPE.registerKey("onmouseup", String.class);
89    static public final PropertyKey ONMOUSEOVER_KEY =
90      TYPE.registerKey("onmouseover", String.class);
91    static public final PropertyKey ONMOUSEMOVE_KEY =
92      TYPE.registerKey("onmousemove", String.class);
93    static public final PropertyKey ONMOUSEOUT_KEY =
94      TYPE.registerKey("onmouseout", String.class);
95    static public final PropertyKey ONKEYPRESS_KEY =
96      TYPE.registerKey("onkeypress", String.class);
97    static public final PropertyKey ONKEYDOWN_KEY =
98      TYPE.registerKey("onkeydown", String.class);
99    static public final PropertyKey ONKEYUP_KEY =
100     TYPE.registerKey("onkeyup", String.class);
101   static public final PropertyKey ONBLUR_KEY =
102     TYPE.registerKey("onblur", String.class);
103   static public final PropertyKey ONFOCUS_KEY =
104     TYPE.registerKey("onfocus", String.class);
105 
106   static public final String COMPONENT_FAMILY =
107     "org.apache.myfaces.trinidad.Go";
108   static public final String COMPONENT_TYPE =
109     "org.apache.myfaces.trinidad.CoreGoLink";
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", "focus", "blur"
115     ));
116 
117   /**
118    * Construct an instance of the CoreGoLink.
119    */
120   public CoreGoLink()
121   {
122     super("org.apache.myfaces.trinidad.Link");
123   }
124 
125   /**
126    * Gets the textual label of the go component.   Go components will
127    *              also render children elements (including text nodes), though not
128    *              all subclasses of the go component will necessarily support
129    *              children.
130    *
131    * @return  the new text value
132    */
133   final public String getText()
134   {
135     return ComponentUtils.resolveString(getProperty(TEXT_KEY));
136   }
137 
138   /**
139    * Sets the textual label of the go component.   Go components will
140    *              also render children elements (including text nodes), though not
141    *              all subclasses of the go component will necessarily support
142    *              children.
143    * 
144    * @param text  the new text value
145    */
146   final public void setText(String text)
147   {
148     setProperty(TEXT_KEY, (text));
149   }
150 
151   /**
152    * Gets whether the go component should be considered disabled.
153    *               This attribute only has meaning when go components are used in certain
154    *               container types, such as global headers and tab bars.
155    *
156    * @return  the new disabled value
157    */
158   final public boolean isDisabled()
159   {
160     return ComponentUtils.resolveBoolean(getProperty(DISABLED_KEY), false);
161   }
162 
163   /**
164    * Sets whether the go component should be considered disabled.
165    *               This attribute only has meaning when go components are used in certain
166    *               container types, such as global headers and tab bars.
167    * 
168    * @param disabled  the new disabled value
169    */
170   final public void setDisabled(boolean disabled)
171   {
172     setProperty(DISABLED_KEY, disabled ? Boolean.TRUE : Boolean.FALSE);
173   }
174 
175   /**
176    * Gets <html>
177    *  Character used to gain quick access to this component.
178    *               For accessibility reasons, this functionality is not supported
179    *               in screen reader mode.
180    *               <p>
181    *               If the same access key appears in multiple input fields in the
182    *               same page of output, the rendering user agent will cycle among
183    *               the elements accessed by the similar keys. Note that user agents
184    *               are inconsistent about dealing with two links having same access
185    *               key, and so the cycling behavior is dependent on what the user agent
186    *               provides.
187    *               </p><p>
188    *                 This attribute is sometimes referred to as the "mnemonic".
189    *               </p><p>
190    *                 The character specified by this attribute
191    *                 <strong>must</strong> exist in the
192    *                 <code>Text</code> attribute of this go component instance.
193    *                 If it does not, the user will receive no visual indication of
194    *                 the existence of the accessKey.
195    *                 </p></html>
196    *
197    * @return  the new accessKey value
198    */
199   final public char getAccessKey()
200   {
201     return ComponentUtils.resolveCharacter((Character)getProperty(ACCESS_KEY_KEY));
202   }
203 
204   /**
205    * Sets <html>
206    *  Character used to gain quick access to this component.
207    *               For accessibility reasons, this functionality is not supported
208    *               in screen reader mode.
209    *               <p>
210    *               If the same access key appears in multiple input fields in the
211    *               same page of output, the rendering user agent will cycle among
212    *               the elements accessed by the similar keys. Note that user agents
213    *               are inconsistent about dealing with two links having same access
214    *               key, and so the cycling behavior is dependent on what the user agent
215    *               provides.
216    *               </p><p>
217    *                 This attribute is sometimes referred to as the "mnemonic".
218    *               </p><p>
219    *                 The character specified by this attribute
220    *                 <strong>must</strong> exist in the
221    *                 <code>Text</code> attribute of this go component instance.
222    *                 If it does not, the user will receive no visual indication of
223    *                 the existence of the accessKey.
224    *                 </p></html>
225    * 
226    * @param accessKey  the new accessKey value
227    */
228   final public void setAccessKey(char accessKey)
229   {
230     setProperty(ACCESS_KEY_KEY, Character.valueOf(accessKey));
231   }
232 
233   /**
234    * Gets the target frame for the go component.
235    *
236    * @return  the new targetFrame value
237    */
238   final public String getTargetFrame()
239   {
240     return ComponentUtils.resolveString(getProperty(TARGET_FRAME_KEY));
241   }
242 
243   /**
244    * Sets the target frame for the go component.
245    * 
246    * @param targetFrame  the new targetFrame value
247    */
248   final public void setTargetFrame(String targetFrame)
249   {
250     setProperty(TARGET_FRAME_KEY, (targetFrame));
251   }
252 
253   /**
254    * Gets the CSS styles to use for this component.
255    *
256    * @return  the new inlineStyle value
257    */
258   final public String getInlineStyle()
259   {
260     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
261   }
262 
263   /**
264    * Sets the CSS styles to use for this component.
265    * 
266    * @param inlineStyle  the new inlineStyle value
267    */
268   final public void setInlineStyle(String inlineStyle)
269   {
270     setProperty(INLINE_STYLE_KEY, (inlineStyle));
271   }
272 
273   /**
274    * Gets a CSS style class to use for this component.
275    *
276    * @return  the new styleClass value
277    */
278   final public String getStyleClass()
279   {
280     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
281   }
282 
283   /**
284    * Sets a CSS style class to use for this component.
285    * 
286    * @param styleClass  the new styleClass value
287    */
288   final public void setStyleClass(String styleClass)
289   {
290     setProperty(STYLE_CLASS_KEY, (styleClass));
291   }
292 
293   /**
294    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
295    *
296    * @return  the new shortDesc value
297    */
298   final public String getShortDesc()
299   {
300     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
301   }
302 
303   /**
304    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
305    * 
306    * @param shortDesc  the new shortDesc value
307    */
308   final public void setShortDesc(String shortDesc)
309   {
310     setProperty(SHORT_DESC_KEY, (shortDesc));
311   }
312 
313   /**
314    * Gets the IDs of the components that should trigger a partial update.
315    *         <p>
316    *         This component will listen on the trigger components. If one of the
317    *         trigger components receives an event that will cause it to update
318    *         in some way, this component will request to be updated too.</p>
319    *         <p>
320    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
321    *         </p>
322    *         <p>
323    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
324    *         or use multiple colons to move up through the NamingContainer. For example,
325    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
326    *         ":::" will pop out of two naming containers, etc. The search for
327    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
328    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
329    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
330    *
331    * @return  the new partialTriggers value
332    */
333   final public String[] getPartialTriggers()
334   {
335     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
336   }
337 
338   /**
339    * Sets the IDs of the components that should trigger a partial update.
340    *         <p>
341    *         This component will listen on the trigger components. If one of the
342    *         trigger components receives an event that will cause it to update
343    *         in some way, this component will request to be updated too.</p>
344    *         <p>
345    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
346    *         </p>
347    *         <p>
348    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
349    *         or use multiple colons to move up through the NamingContainer. For example,
350    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
351    *         ":::" will pop out of two naming containers, etc. The search for
352    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
353    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
354    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
355    * 
356    * @param partialTriggers  the new partialTriggers value
357    */
358   final public void setPartialTriggers(String[] partialTriggers)
359   {
360     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
361   }
362 
363   /**
364    * Gets an onclick Javascript handler.
365    *
366    * @return  the new onclick value
367    */
368   final public String getOnclick()
369   {
370     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
371   }
372 
373   /**
374    * Sets an onclick Javascript handler.
375    * 
376    * @param onclick  the new onclick value
377    */
378   final public void setOnclick(String onclick)
379   {
380     setProperty(ONCLICK_KEY, (onclick));
381   }
382 
383   /**
384    * Gets an ondblclick Javascript handler.
385    *
386    * @return  the new ondblclick value
387    */
388   final public String getOndblclick()
389   {
390     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
391   }
392 
393   /**
394    * Sets an ondblclick Javascript handler.
395    * 
396    * @param ondblclick  the new ondblclick value
397    */
398   final public void setOndblclick(String ondblclick)
399   {
400     setProperty(ONDBLCLICK_KEY, (ondblclick));
401   }
402 
403   /**
404    * Gets an onmousedown Javascript handler.
405    *
406    * @return  the new onmousedown value
407    */
408   final public String getOnmousedown()
409   {
410     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
411   }
412 
413   /**
414    * Sets an onmousedown Javascript handler.
415    * 
416    * @param onmousedown  the new onmousedown value
417    */
418   final public void setOnmousedown(String onmousedown)
419   {
420     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
421   }
422 
423   /**
424    * Gets an onmouseup Javascript handler.
425    *
426    * @return  the new onmouseup value
427    */
428   final public String getOnmouseup()
429   {
430     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
431   }
432 
433   /**
434    * Sets an onmouseup Javascript handler.
435    * 
436    * @param onmouseup  the new onmouseup value
437    */
438   final public void setOnmouseup(String onmouseup)
439   {
440     setProperty(ONMOUSEUP_KEY, (onmouseup));
441   }
442 
443   /**
444    * Gets an onmouseover Javascript handler.
445    *
446    * @return  the new onmouseover value
447    */
448   final public String getOnmouseover()
449   {
450     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
451   }
452 
453   /**
454    * Sets an onmouseover Javascript handler.
455    * 
456    * @param onmouseover  the new onmouseover value
457    */
458   final public void setOnmouseover(String onmouseover)
459   {
460     setProperty(ONMOUSEOVER_KEY, (onmouseover));
461   }
462 
463   /**
464    * Gets an onmousemove Javascript handler.
465    *
466    * @return  the new onmousemove value
467    */
468   final public String getOnmousemove()
469   {
470     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
471   }
472 
473   /**
474    * Sets an onmousemove Javascript handler.
475    * 
476    * @param onmousemove  the new onmousemove value
477    */
478   final public void setOnmousemove(String onmousemove)
479   {
480     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
481   }
482 
483   /**
484    * Gets an onmouseout Javascript handler.
485    *
486    * @return  the new onmouseout value
487    */
488   final public String getOnmouseout()
489   {
490     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
491   }
492 
493   /**
494    * Sets an onmouseout Javascript handler.
495    * 
496    * @param onmouseout  the new onmouseout value
497    */
498   final public void setOnmouseout(String onmouseout)
499   {
500     setProperty(ONMOUSEOUT_KEY, (onmouseout));
501   }
502 
503   /**
504    * Gets an onkeypress Javascript handler.
505    *
506    * @return  the new onkeypress value
507    */
508   final public String getOnkeypress()
509   {
510     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
511   }
512 
513   /**
514    * Sets an onkeypress Javascript handler.
515    * 
516    * @param onkeypress  the new onkeypress value
517    */
518   final public void setOnkeypress(String onkeypress)
519   {
520     setProperty(ONKEYPRESS_KEY, (onkeypress));
521   }
522 
523   /**
524    * Gets an onkeydown Javascript handler.
525    *
526    * @return  the new onkeydown value
527    */
528   final public String getOnkeydown()
529   {
530     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
531   }
532 
533   /**
534    * Sets an onkeydown Javascript handler.
535    * 
536    * @param onkeydown  the new onkeydown value
537    */
538   final public void setOnkeydown(String onkeydown)
539   {
540     setProperty(ONKEYDOWN_KEY, (onkeydown));
541   }
542 
543   /**
544    * Gets an onkeyup Javascript handler.
545    *
546    * @return  the new onkeyup value
547    */
548   final public String getOnkeyup()
549   {
550     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
551   }
552 
553   /**
554    * Sets an onkeyup Javascript handler.
555    * 
556    * @param onkeyup  the new onkeyup value
557    */
558   final public void setOnkeyup(String onkeyup)
559   {
560     setProperty(ONKEYUP_KEY, (onkeyup));
561   }
562 
563   /**
564    * Gets the event handler for the component losing the focus.
565    *
566    * @return  the new onblur value
567    */
568   final public String getOnblur()
569   {
570     return ComponentUtils.resolveString(getProperty(ONBLUR_KEY));
571   }
572 
573   /**
574    * Sets the event handler for the component losing the focus.
575    * 
576    * @param onblur  the new onblur value
577    */
578   final public void setOnblur(String onblur)
579   {
580     setProperty(ONBLUR_KEY, (onblur));
581   }
582 
583   /**
584    * Gets the event handler for the component gaining the focus.
585    *
586    * @return  the new onfocus value
587    */
588   final public String getOnfocus()
589   {
590     return ComponentUtils.resolveString(getProperty(ONFOCUS_KEY));
591   }
592 
593   /**
594    * Sets the event handler for the component gaining the focus.
595    * 
596    * @param onfocus  the new onfocus value
597    */
598   final public void setOnfocus(String onfocus)
599   {
600     setProperty(ONFOCUS_KEY, (onfocus));
601   }
602 
603   @Override
604   public String getDefaultEventName()
605   {
606     return "click";
607   }
608 
609   @Override
610   public Collection<String> getEventNames()
611   {
612     return _EVENT_NAMES;
613   }
614 
615   @Override
616   public Map<String, List<ClientBehavior>> getClientBehaviors()
617   {
618     return super.getClientBehaviors();
619   }
620 
621   @Override
622   public void addClientBehavior(
623     String         eventName,
624     ClientBehavior behavior)
625   {
626     super.addClientBehavior(eventName, behavior);
627   }
628 
629   @Override
630   public String getFamily()
631   {
632     return COMPONENT_FAMILY;
633   }
634 
635   @Override
636   protected FacesBean.Type getBeanType()
637   {
638     return TYPE;
639   }
640 
641   /**
642    * Construct an instance of the CoreGoLink.
643    */
644   protected CoreGoLink(
645     String rendererType
646     )
647   {
648     super(rendererType);
649   }
650 
651   static
652   {
653     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Go","org.apache.myfaces.trinidad.Link");
654   }
655 }