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.html;
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.UIXComponentBase;
34  import org.apache.myfaces.trinidad.util.ComponentUtils;
35  
36  /**
37   *
38   * CellFormat components are used to format cells in a
39   *           rowLayout.  It is a container of other layout elements which
40   *           allows its contents to take additional formatting, such as vertical
41   *           alignment, width, or colspan.
42   *
43   * <h4>Events:</h4>
44   * <table border="1" width="100%" cellpadding="3" summary="">
45   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
46   * <th align="left">Type</th>
47   * <th align="left">Phases</th>
48   * <th align="left">Description</th>
49   * </tr>
50   * <tr class="TableRowColor">
51   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
52   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
53   * <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>
54   * </tr>
55   * </table>
56   */
57  public class HtmlCellFormat extends UIXComponentBase
58                              implements ClientBehaviorHolder
59  {
60    static public final String HALIGN_RIGHT = "right";
61    static public final String HALIGN_START = "start";
62    static public final String HALIGN_LEFT = "left";
63    static public final String HALIGN_END = "end";
64    static public final String HALIGN_CENTER = "center";
65    static public final String VALIGN_MIDDLE = "middle";
66    static public final String VALIGN_TOP = "top";
67    static public final String VALIGN_BOTTOM = "bottom";
68    static public final FacesBean.Type TYPE = new FacesBean.Type(
69      UIXComponentBase.TYPE);
70    static public final PropertyKey SHORT_TEXT_KEY =
71      TYPE.registerKey("shortText", String.class);
72    static public final PropertyKey HALIGN_KEY =
73      TYPE.registerKey("halign", String.class);
74    static public final PropertyKey VALIGN_KEY =
75      TYPE.registerKey("valign", String.class);
76    static public final PropertyKey WIDTH_KEY =
77      TYPE.registerKey("width", String.class);
78    static public final PropertyKey HEIGHT_KEY =
79      TYPE.registerKey("height", String.class);
80    static public final PropertyKey COLUMN_SPAN_KEY =
81      TYPE.registerKey("columnSpan", Integer.class);
82    static public final PropertyKey ROW_SPAN_KEY =
83      TYPE.registerKey("rowSpan", Integer.class);
84    static public final PropertyKey WRAPPING_DISABLED_KEY =
85      TYPE.registerKey("wrappingDisabled", Boolean.class, Boolean.FALSE);
86    static public final PropertyKey HEADERS_KEY =
87      TYPE.registerKey("headers", String.class);
88    static public final PropertyKey HEADER_KEY =
89      TYPE.registerKey("header", Boolean.class);
90    static public final PropertyKey SHORT_DESC_KEY =
91      TYPE.registerKey("shortDesc", String.class);
92    static public final PropertyKey PARTIAL_TRIGGERS_KEY =
93      TYPE.registerKey("partialTriggers", String[].class);
94    static public final PropertyKey ONCLICK_KEY =
95      TYPE.registerKey("onclick", String.class);
96    static public final PropertyKey ONDBLCLICK_KEY =
97      TYPE.registerKey("ondblclick", String.class);
98    static public final PropertyKey ONMOUSEDOWN_KEY =
99      TYPE.registerKey("onmousedown", String.class);
100   static public final PropertyKey ONMOUSEUP_KEY =
101     TYPE.registerKey("onmouseup", String.class);
102   static public final PropertyKey ONMOUSEOVER_KEY =
103     TYPE.registerKey("onmouseover", String.class);
104   static public final PropertyKey ONMOUSEMOVE_KEY =
105     TYPE.registerKey("onmousemove", String.class);
106   static public final PropertyKey ONMOUSEOUT_KEY =
107     TYPE.registerKey("onmouseout", String.class);
108   static public final PropertyKey ONKEYPRESS_KEY =
109     TYPE.registerKey("onkeypress", String.class);
110   static public final PropertyKey ONKEYDOWN_KEY =
111     TYPE.registerKey("onkeydown", String.class);
112   static public final PropertyKey ONKEYUP_KEY =
113     TYPE.registerKey("onkeyup", String.class);
114   static public final PropertyKey STYLE_CLASS_KEY =
115     TYPE.registerKey("styleClass", String.class);
116   static public final PropertyKey INLINE_STYLE_KEY =
117     TYPE.registerKey("inlineStyle", String.class);
118 
119   static public final String COMPONENT_FAMILY =
120     "org.apache.myfaces.trinidad.CellFormat";
121   static public final String COMPONENT_TYPE =
122     "org.apache.myfaces.trinidad.HtmlCellFormat";
123   // Supported client events for client behaviors:
124   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
125     Arrays.asList(
126       "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
127       "mouseout", "keypress", "keydown", "keyup"
128     ));
129 
130   /**
131    * Construct an instance of the HtmlCellFormat.
132    */
133   public HtmlCellFormat()
134   {
135     super("org.apache.myfaces.trinidad.CellFormat");
136   }
137 
138   /**
139    * Gets This attribute should be used to provide an abbreviated form of
140    *              the cell's content, and may be rendered by user agents when
141    *              appropriate in place of the cell's content. Abbreviated names
142    *              should be short since user agents may render them repeatedly
143    *              (especially if this cell is a header cell).
144    *
145    * @return  the new shortText value
146    */
147   final public String getShortText()
148   {
149     return ComponentUtils.resolveString(getProperty(SHORT_TEXT_KEY));
150   }
151 
152   /**
153    * Sets This attribute should be used to provide an abbreviated form of
154    *              the cell's content, and may be rendered by user agents when
155    *              appropriate in place of the cell's content. Abbreviated names
156    *              should be short since user agents may render them repeatedly
157    *              (especially if this cell is a header cell).
158    * 
159    * @param shortText  the new shortText value
160    */
161   final public void setShortText(String shortText)
162   {
163     setProperty(SHORT_TEXT_KEY, (shortText));
164   }
165 
166   /**
167    * Gets the horizontal alignment of the grid row elements.
168    *               The acceptable values are "center", "left", "right", "start", and "end".
169    *
170    * @return  the new halign value
171    */
172   final public String getHalign()
173   {
174     return ComponentUtils.resolveString(getProperty(HALIGN_KEY));
175   }
176 
177   /**
178    * Sets the horizontal alignment of the grid row elements.
179    *               The acceptable values are "center", "left", "right", "start", and "end".
180    * 
181    * @param halign  the new halign value
182    */
183   final public void setHalign(String halign)
184   {
185     setProperty(HALIGN_KEY, (halign));
186   }
187 
188   /**
189    * Gets the vertical alignment of the grid row elements.
190    *               The acceptable values are "middle", "top", and "bottom".
191    *
192    * @return  the new valign value
193    */
194   final public String getValign()
195   {
196     return ComponentUtils.resolveString(getProperty(VALIGN_KEY));
197   }
198 
199   /**
200    * Sets the vertical alignment of the grid row elements.
201    *               The acceptable values are "middle", "top", and "bottom".
202    * 
203    * @param valign  the new valign value
204    */
205   final public void setValign(String valign)
206   {
207     setProperty(VALIGN_KEY, (valign));
208   }
209 
210   /**
211    * Gets the preferred width of the enclosed layout elements.
212    *
213    * @return  the new width value
214    */
215   final public String getWidth()
216   {
217     return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
218   }
219 
220   /**
221    * Sets the preferred width of the enclosed layout elements.
222    * 
223    * @param width  the new width value
224    */
225   final public void setWidth(String width)
226   {
227     setProperty(WIDTH_KEY, (width));
228   }
229 
230   /**
231    * Gets the preferred height of the enclosed layout elements.
232    *
233    * @return  the new height value
234    */
235   final public String getHeight()
236   {
237     return ComponentUtils.resolveString(getProperty(HEIGHT_KEY));
238   }
239 
240   /**
241    * Sets the preferred height of the enclosed layout elements.
242    * 
243    * @param height  the new height value
244    */
245   final public void setHeight(String height)
246   {
247     setProperty(HEIGHT_KEY, (height));
248   }
249 
250   /**
251    * Gets the number of cells wide the child layout element will be.
252    *
253    * @return  the new columnSpan value
254    */
255   final public int getColumnSpan()
256   {
257     return ComponentUtils.resolveInteger(getProperty(COLUMN_SPAN_KEY));
258   }
259 
260   /**
261    * Sets the number of cells wide the child layout element will be.
262    * 
263    * @param columnSpan  the new columnSpan value
264    */
265   final public void setColumnSpan(int columnSpan)
266   {
267     setProperty(COLUMN_SPAN_KEY, Integer.valueOf(columnSpan));
268   }
269 
270   /**
271    * Gets the number of cells high the child layout element will be.
272    *
273    * @return  the new rowSpan value
274    */
275   final public int getRowSpan()
276   {
277     return ComponentUtils.resolveInteger(getProperty(ROW_SPAN_KEY));
278   }
279 
280   /**
281    * Sets the number of cells high the child layout element will be.
282    * 
283    * @param rowSpan  the new rowSpan value
284    */
285   final public void setRowSpan(int rowSpan)
286   {
287     setProperty(ROW_SPAN_KEY, Integer.valueOf(rowSpan));
288   }
289 
290   /**
291    * Gets whether automatic text wrapping should be disabled for
292    *               this cell.
293    *
294    * @return  the new wrappingDisabled value
295    */
296   final public boolean isWrappingDisabled()
297   {
298     return ComponentUtils.resolveBoolean(getProperty(WRAPPING_DISABLED_KEY), false);
299   }
300 
301   /**
302    * Sets whether automatic text wrapping should be disabled for
303    *               this cell.
304    * 
305    * @param wrappingDisabled  the new wrappingDisabled value
306    */
307   final public void setWrappingDisabled(boolean wrappingDisabled)
308   {
309     setProperty(WRAPPING_DISABLED_KEY, wrappingDisabled ? Boolean.TRUE : Boolean.FALSE);
310   }
311 
312   /**
313    * Gets Indicates which table cells are the headers for this cell. This
314    *              attribute is used by screen readers to associate header
315    *              information with data cells. This must be set to a
316    *              space-separated list of IDs. Each ID must be the ID of a
317    *              pertinent header cell.
318    *
319    * @return  the new headers value
320    */
321   final public String getHeaders()
322   {
323     return ComponentUtils.resolveString(getProperty(HEADERS_KEY));
324   }
325 
326   /**
327    * Sets Indicates which table cells are the headers for this cell. This
328    *              attribute is used by screen readers to associate header
329    *              information with data cells. This must be set to a
330    *              space-separated list of IDs. Each ID must be the ID of a
331    *              pertinent header cell.
332    * 
333    * @param headers  the new headers value
334    */
335   final public void setHeaders(String headers)
336   {
337     setProperty(HEADERS_KEY, (headers));
338   }
339 
340   /**
341    * Gets Indicates whether or not this table cell is a header cell or a data cell.
342    *         Setting this attribute to 'true' will mark this cell as a header cell.
343    *
344    * @return  the new header value
345    */
346   final public boolean isHeader()
347   {
348     return ComponentUtils.resolveBoolean(getProperty(HEADER_KEY));
349   }
350 
351   /**
352    * Sets Indicates whether or not this table cell is a header cell or a data cell.
353    *         Setting this attribute to 'true' will mark this cell as a header cell.
354    * 
355    * @param header  the new header value
356    */
357   final public void setHeader(boolean header)
358   {
359     setProperty(HEADER_KEY, header ? Boolean.TRUE : Boolean.FALSE);
360   }
361 
362   /**
363    * Gets the short description of the bean.  This text
364    *          is commonly used by user agents to display tooltip help text.
365    *
366    * @return  the new shortDesc value
367    */
368   final public String getShortDesc()
369   {
370     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
371   }
372 
373   /**
374    * Sets the short description of the bean.  This text
375    *          is commonly used by user agents to display tooltip help text.
376    * 
377    * @param shortDesc  the new shortDesc value
378    */
379   final public void setShortDesc(String shortDesc)
380   {
381     setProperty(SHORT_DESC_KEY, (shortDesc));
382   }
383 
384   /**
385    * Gets the IDs of the components that should trigger a partial update.
386    *          This component will listen on the trigger components. If one of the
387    *          trigger components receives an event that will cause it to update
388    *          in some way, this component will request to be updated too.
389    *
390    * @return  the new partialTriggers value
391    */
392   final public String[] getPartialTriggers()
393   {
394     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
395   }
396 
397   /**
398    * Sets the IDs of the components that should trigger a partial update.
399    *          This component will listen on the trigger components. If one of the
400    *          trigger components receives an event that will cause it to update
401    *          in some way, this component will request to be updated too.
402    * 
403    * @param partialTriggers  the new partialTriggers value
404    */
405   final public void setPartialTriggers(String[] partialTriggers)
406   {
407     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
408   }
409 
410   /**
411    * Gets an onclick Javascript handler.
412    *
413    * @return  the new onclick value
414    */
415   final public String getOnclick()
416   {
417     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
418   }
419 
420   /**
421    * Sets an onclick Javascript handler.
422    * 
423    * @param onclick  the new onclick value
424    */
425   final public void setOnclick(String onclick)
426   {
427     setProperty(ONCLICK_KEY, (onclick));
428   }
429 
430   /**
431    * Gets an ondblclick Javascript handler.
432    *
433    * @return  the new ondblclick value
434    */
435   final public String getOndblclick()
436   {
437     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
438   }
439 
440   /**
441    * Sets an ondblclick Javascript handler.
442    * 
443    * @param ondblclick  the new ondblclick value
444    */
445   final public void setOndblclick(String ondblclick)
446   {
447     setProperty(ONDBLCLICK_KEY, (ondblclick));
448   }
449 
450   /**
451    * Gets an onmousedown Javascript handler.
452    *
453    * @return  the new onmousedown value
454    */
455   final public String getOnmousedown()
456   {
457     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
458   }
459 
460   /**
461    * Sets an onmousedown Javascript handler.
462    * 
463    * @param onmousedown  the new onmousedown value
464    */
465   final public void setOnmousedown(String onmousedown)
466   {
467     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
468   }
469 
470   /**
471    * Gets an onmouseup Javascript handler.
472    *
473    * @return  the new onmouseup value
474    */
475   final public String getOnmouseup()
476   {
477     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
478   }
479 
480   /**
481    * Sets an onmouseup Javascript handler.
482    * 
483    * @param onmouseup  the new onmouseup value
484    */
485   final public void setOnmouseup(String onmouseup)
486   {
487     setProperty(ONMOUSEUP_KEY, (onmouseup));
488   }
489 
490   /**
491    * Gets an onmouseover Javascript handler.
492    *
493    * @return  the new onmouseover value
494    */
495   final public String getOnmouseover()
496   {
497     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
498   }
499 
500   /**
501    * Sets an onmouseover Javascript handler.
502    * 
503    * @param onmouseover  the new onmouseover value
504    */
505   final public void setOnmouseover(String onmouseover)
506   {
507     setProperty(ONMOUSEOVER_KEY, (onmouseover));
508   }
509 
510   /**
511    * Gets an onmousemove Javascript handler.
512    *
513    * @return  the new onmousemove value
514    */
515   final public String getOnmousemove()
516   {
517     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
518   }
519 
520   /**
521    * Sets an onmousemove Javascript handler.
522    * 
523    * @param onmousemove  the new onmousemove value
524    */
525   final public void setOnmousemove(String onmousemove)
526   {
527     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
528   }
529 
530   /**
531    * Gets an onmouseout Javascript handler.
532    *
533    * @return  the new onmouseout value
534    */
535   final public String getOnmouseout()
536   {
537     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
538   }
539 
540   /**
541    * Sets an onmouseout Javascript handler.
542    * 
543    * @param onmouseout  the new onmouseout value
544    */
545   final public void setOnmouseout(String onmouseout)
546   {
547     setProperty(ONMOUSEOUT_KEY, (onmouseout));
548   }
549 
550   /**
551    * Gets an onkeypress Javascript handler.
552    *
553    * @return  the new onkeypress value
554    */
555   final public String getOnkeypress()
556   {
557     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
558   }
559 
560   /**
561    * Sets an onkeypress Javascript handler.
562    * 
563    * @param onkeypress  the new onkeypress value
564    */
565   final public void setOnkeypress(String onkeypress)
566   {
567     setProperty(ONKEYPRESS_KEY, (onkeypress));
568   }
569 
570   /**
571    * Gets an onkeydown Javascript handler.
572    *
573    * @return  the new onkeydown value
574    */
575   final public String getOnkeydown()
576   {
577     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
578   }
579 
580   /**
581    * Sets an onkeydown Javascript handler.
582    * 
583    * @param onkeydown  the new onkeydown value
584    */
585   final public void setOnkeydown(String onkeydown)
586   {
587     setProperty(ONKEYDOWN_KEY, (onkeydown));
588   }
589 
590   /**
591    * Gets an onkeyup Javascript handler.
592    *
593    * @return  the new onkeyup value
594    */
595   final public String getOnkeyup()
596   {
597     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
598   }
599 
600   /**
601    * Sets an onkeyup Javascript handler.
602    * 
603    * @param onkeyup  the new onkeyup value
604    */
605   final public void setOnkeyup(String onkeyup)
606   {
607     setProperty(ONKEYUP_KEY, (onkeyup));
608   }
609 
610   /**
611    * Gets the CSS style class of the bean.
612    *
613    * @return  the new styleClass value
614    */
615   final public String getStyleClass()
616   {
617     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
618   }
619 
620   /**
621    * Sets the CSS style class of the bean.
622    * 
623    * @param styleClass  the new styleClass value
624    */
625   final public void setStyleClass(String styleClass)
626   {
627     setProperty(STYLE_CLASS_KEY, (styleClass));
628   }
629 
630   /**
631    * Gets the inline CSS style for this element
632    *
633    * @return  the new inlineStyle value
634    */
635   final public String getInlineStyle()
636   {
637     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
638   }
639 
640   /**
641    * Sets the inline CSS style for this element
642    * 
643    * @param inlineStyle  the new inlineStyle value
644    */
645   final public void setInlineStyle(String inlineStyle)
646   {
647     setProperty(INLINE_STYLE_KEY, (inlineStyle));
648   }
649 
650   @Override
651   public String getDefaultEventName()
652   {
653     return "click";
654   }
655 
656   @Override
657   public Collection<String> getEventNames()
658   {
659     return _EVENT_NAMES;
660   }
661 
662   @Override
663   public Map<String, List<ClientBehavior>> getClientBehaviors()
664   {
665     return super.getClientBehaviors();
666   }
667 
668   @Override
669   public void addClientBehavior(
670     String         eventName,
671     ClientBehavior behavior)
672   {
673     super.addClientBehavior(eventName, behavior);
674   }
675 
676   @Override
677   public String getFamily()
678   {
679     return COMPONENT_FAMILY;
680   }
681 
682   @Override
683   protected FacesBean.Type getBeanType()
684   {
685     return TYPE;
686   }
687 
688   /**
689    * Construct an instance of the HtmlCellFormat.
690    */
691   protected HtmlCellFormat(
692     String rendererType
693     )
694   {
695     super(rendererType);
696   }
697 
698   static
699   {
700     TYPE.lockAndRegister("org.apache.myfaces.trinidad.CellFormat","org.apache.myfaces.trinidad.CellFormat");
701   }
702 }