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   * RowLayout components can be used on their own, or to
39   *           define a row of a tableLayout.  It can contain any arbitrary
40   *           content, one per cell, but clients that need formatting beyond just a
41   *           simple <td> element must wrap the child nodes in cellFormat
42   *           components.
43   *
44   * <h4>Events:</h4>
45   * <table border="1" width="100%" cellpadding="3" summary="">
46   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
47   * <th align="left">Type</th>
48   * <th align="left">Phases</th>
49   * <th align="left">Description</th>
50   * </tr>
51   * <tr class="TableRowColor">
52   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
53   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
54   * <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>
55   * </tr>
56   * </table>
57   */
58  public class HtmlRowLayout extends UIXComponentBase
59                             implements ClientBehaviorHolder
60  {
61    static public final String HALIGN_RIGHT = "right";
62    static public final String HALIGN_START = "start";
63    static public final String HALIGN_LEFT = "left";
64    static public final String HALIGN_END = "end";
65    static public final String HALIGN_CENTER = "center";
66    static public final String VALIGN_MIDDLE = "middle";
67    static public final String VALIGN_TOP = "top";
68    static public final String VALIGN_BOTTOM = "bottom";
69    static public final FacesBean.Type TYPE = new FacesBean.Type(
70      UIXComponentBase.TYPE);
71    static public final PropertyKey HALIGN_KEY =
72      TYPE.registerKey("halign", String.class);
73    static public final PropertyKey VALIGN_KEY =
74      TYPE.registerKey("valign", String.class);
75    static public final PropertyKey WIDTH_KEY =
76      TYPE.registerKey("width", 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 STYLE_CLASS_KEY =
102     TYPE.registerKey("styleClass", String.class);
103   static public final PropertyKey INLINE_STYLE_KEY =
104     TYPE.registerKey("inlineStyle", String.class);
105 
106   static public final String COMPONENT_FAMILY =
107     "org.apache.myfaces.trinidad.RowLayout";
108   static public final String COMPONENT_TYPE =
109     "org.apache.myfaces.trinidad.HtmlRowLayout";
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 HtmlRowLayout.
119    */
120   public HtmlRowLayout()
121   {
122     super("org.apache.myfaces.trinidad.RowLayout");
123   }
124 
125   /**
126    * Gets the default horizontal alignment of cells in this row.
127    *               The acceptable values are "center", "left", "right", "start", and "end".
128    *
129    * @return  the new halign value
130    */
131   final public String getHalign()
132   {
133     return ComponentUtils.resolveString(getProperty(HALIGN_KEY));
134   }
135 
136   /**
137    * Sets the default horizontal alignment of cells in this row.
138    *               The acceptable values are "center", "left", "right", "start", and "end".
139    * 
140    * @param halign  the new halign value
141    */
142   final public void setHalign(String halign)
143   {
144     setProperty(HALIGN_KEY, (halign));
145   }
146 
147   /**
148    * Gets the default vertical alignment of cells in this row.
149    *               The acceptable values are "middle", "top", and "bottom".
150    *
151    * @return  the new valign value
152    */
153   final public String getValign()
154   {
155     return ComponentUtils.resolveString(getProperty(VALIGN_KEY));
156   }
157 
158   /**
159    * Sets the default vertical alignment of cells in this row.
160    *               The acceptable values are "middle", "top", and "bottom".
161    * 
162    * @param valign  the new valign value
163    */
164   final public void setValign(String valign)
165   {
166     setProperty(VALIGN_KEY, (valign));
167   }
168 
169   /**
170    * Gets the preferred total width of the layout.
171    *               This attribute is ignored when the row layout is inside
172    *               of a table layout.
173    *
174    * @return  the new width value
175    */
176   final public String getWidth()
177   {
178     return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
179   }
180 
181   /**
182    * Sets the preferred total width of the layout.
183    *               This attribute is ignored when the row layout is inside
184    *               of a table layout.
185    * 
186    * @param width  the new width value
187    */
188   final public void setWidth(String width)
189   {
190     setProperty(WIDTH_KEY, (width));
191   }
192 
193   /**
194    * Gets the short description of the bean.  This text
195    *          is commonly used by user agents to display tooltip help text.
196    *
197    * @return  the new shortDesc value
198    */
199   final public String getShortDesc()
200   {
201     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
202   }
203 
204   /**
205    * Sets the short description of the bean.  This text
206    *          is commonly used by user agents to display tooltip help text.
207    * 
208    * @param shortDesc  the new shortDesc value
209    */
210   final public void setShortDesc(String shortDesc)
211   {
212     setProperty(SHORT_DESC_KEY, (shortDesc));
213   }
214 
215   /**
216    * Gets the IDs of the components that should trigger a partial update.
217    *          This component will listen on the trigger components. If one of the
218    *          trigger components receives an event that will cause it to update
219    *          in some way, this component will request to be updated too.
220    *
221    * @return  the new partialTriggers value
222    */
223   final public String[] getPartialTriggers()
224   {
225     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
226   }
227 
228   /**
229    * Sets the IDs of the components that should trigger a partial update.
230    *          This component will listen on the trigger components. If one of the
231    *          trigger components receives an event that will cause it to update
232    *          in some way, this component will request to be updated too.
233    * 
234    * @param partialTriggers  the new partialTriggers value
235    */
236   final public void setPartialTriggers(String[] partialTriggers)
237   {
238     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
239   }
240 
241   /**
242    * Gets an onclick Javascript handler.
243    *
244    * @return  the new onclick value
245    */
246   final public String getOnclick()
247   {
248     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
249   }
250 
251   /**
252    * Sets an onclick Javascript handler.
253    * 
254    * @param onclick  the new onclick value
255    */
256   final public void setOnclick(String onclick)
257   {
258     setProperty(ONCLICK_KEY, (onclick));
259   }
260 
261   /**
262    * Gets an ondblclick Javascript handler.
263    *
264    * @return  the new ondblclick value
265    */
266   final public String getOndblclick()
267   {
268     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
269   }
270 
271   /**
272    * Sets an ondblclick Javascript handler.
273    * 
274    * @param ondblclick  the new ondblclick value
275    */
276   final public void setOndblclick(String ondblclick)
277   {
278     setProperty(ONDBLCLICK_KEY, (ondblclick));
279   }
280 
281   /**
282    * Gets an onmousedown Javascript handler.
283    *
284    * @return  the new onmousedown value
285    */
286   final public String getOnmousedown()
287   {
288     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
289   }
290 
291   /**
292    * Sets an onmousedown Javascript handler.
293    * 
294    * @param onmousedown  the new onmousedown value
295    */
296   final public void setOnmousedown(String onmousedown)
297   {
298     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
299   }
300 
301   /**
302    * Gets an onmouseup Javascript handler.
303    *
304    * @return  the new onmouseup value
305    */
306   final public String getOnmouseup()
307   {
308     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
309   }
310 
311   /**
312    * Sets an onmouseup Javascript handler.
313    * 
314    * @param onmouseup  the new onmouseup value
315    */
316   final public void setOnmouseup(String onmouseup)
317   {
318     setProperty(ONMOUSEUP_KEY, (onmouseup));
319   }
320 
321   /**
322    * Gets an onmouseover Javascript handler.
323    *
324    * @return  the new onmouseover value
325    */
326   final public String getOnmouseover()
327   {
328     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
329   }
330 
331   /**
332    * Sets an onmouseover Javascript handler.
333    * 
334    * @param onmouseover  the new onmouseover value
335    */
336   final public void setOnmouseover(String onmouseover)
337   {
338     setProperty(ONMOUSEOVER_KEY, (onmouseover));
339   }
340 
341   /**
342    * Gets an onmousemove Javascript handler.
343    *
344    * @return  the new onmousemove value
345    */
346   final public String getOnmousemove()
347   {
348     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
349   }
350 
351   /**
352    * Sets an onmousemove Javascript handler.
353    * 
354    * @param onmousemove  the new onmousemove value
355    */
356   final public void setOnmousemove(String onmousemove)
357   {
358     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
359   }
360 
361   /**
362    * Gets an onmouseout Javascript handler.
363    *
364    * @return  the new onmouseout value
365    */
366   final public String getOnmouseout()
367   {
368     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
369   }
370 
371   /**
372    * Sets an onmouseout Javascript handler.
373    * 
374    * @param onmouseout  the new onmouseout value
375    */
376   final public void setOnmouseout(String onmouseout)
377   {
378     setProperty(ONMOUSEOUT_KEY, (onmouseout));
379   }
380 
381   /**
382    * Gets an onkeypress Javascript handler.
383    *
384    * @return  the new onkeypress value
385    */
386   final public String getOnkeypress()
387   {
388     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
389   }
390 
391   /**
392    * Sets an onkeypress Javascript handler.
393    * 
394    * @param onkeypress  the new onkeypress value
395    */
396   final public void setOnkeypress(String onkeypress)
397   {
398     setProperty(ONKEYPRESS_KEY, (onkeypress));
399   }
400 
401   /**
402    * Gets an onkeydown Javascript handler.
403    *
404    * @return  the new onkeydown value
405    */
406   final public String getOnkeydown()
407   {
408     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
409   }
410 
411   /**
412    * Sets an onkeydown Javascript handler.
413    * 
414    * @param onkeydown  the new onkeydown value
415    */
416   final public void setOnkeydown(String onkeydown)
417   {
418     setProperty(ONKEYDOWN_KEY, (onkeydown));
419   }
420 
421   /**
422    * Gets an onkeyup Javascript handler.
423    *
424    * @return  the new onkeyup value
425    */
426   final public String getOnkeyup()
427   {
428     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
429   }
430 
431   /**
432    * Sets an onkeyup Javascript handler.
433    * 
434    * @param onkeyup  the new onkeyup value
435    */
436   final public void setOnkeyup(String onkeyup)
437   {
438     setProperty(ONKEYUP_KEY, (onkeyup));
439   }
440 
441   /**
442    * Gets the CSS style class of the bean.
443    *
444    * @return  the new styleClass value
445    */
446   final public String getStyleClass()
447   {
448     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
449   }
450 
451   /**
452    * Sets the CSS style class of the bean.
453    * 
454    * @param styleClass  the new styleClass value
455    */
456   final public void setStyleClass(String styleClass)
457   {
458     setProperty(STYLE_CLASS_KEY, (styleClass));
459   }
460 
461   /**
462    * Gets the inline CSS style for this element
463    *
464    * @return  the new inlineStyle value
465    */
466   final public String getInlineStyle()
467   {
468     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
469   }
470 
471   /**
472    * Sets the inline CSS style for this element
473    * 
474    * @param inlineStyle  the new inlineStyle value
475    */
476   final public void setInlineStyle(String inlineStyle)
477   {
478     setProperty(INLINE_STYLE_KEY, (inlineStyle));
479   }
480 
481   @Override
482   public String getDefaultEventName()
483   {
484     return "click";
485   }
486 
487   @Override
488   public Collection<String> getEventNames()
489   {
490     return _EVENT_NAMES;
491   }
492 
493   @Override
494   public Map<String, List<ClientBehavior>> getClientBehaviors()
495   {
496     return super.getClientBehaviors();
497   }
498 
499   @Override
500   public void addClientBehavior(
501     String         eventName,
502     ClientBehavior behavior)
503   {
504     super.addClientBehavior(eventName, behavior);
505   }
506 
507   @Override
508   public String getFamily()
509   {
510     return COMPONENT_FAMILY;
511   }
512 
513   @Override
514   protected FacesBean.Type getBeanType()
515   {
516     return TYPE;
517   }
518 
519   /**
520    * Construct an instance of the HtmlRowLayout.
521    */
522   protected HtmlRowLayout(
523     String rendererType
524     )
525   {
526     super(rendererType);
527   }
528 
529   static
530   {
531     TYPE.lockAndRegister("org.apache.myfaces.trinidad.RowLayout","org.apache.myfaces.trinidad.RowLayout");
532   }
533 }