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.UIComponent;
30  import javax.faces.component.behavior.ClientBehavior;
31  import javax.faces.component.behavior.ClientBehaviorHolder;
32  import org.apache.myfaces.trinidad.bean.FacesBean;
33  import org.apache.myfaces.trinidad.bean.PropertyKey;
34  import org.apache.myfaces.trinidad.component.UIXComponentBase;
35  import org.apache.myfaces.trinidad.util.ComponentUtils;
36  
37  /**
38   *
39   * frameBorderLayout is a layout bean which can be used to place seven
40   *           frames at left, right, top, bottom, innerLeft, innerRight and center
41   *           positions.  It does not render any children except for the specified
42   *           facets which must all be either frames or
43   *           frameBorderLayouts. The user may use either left/right or
44   *           start/end as facets, but not both.  Left/right takes
45   *           precedence over start/end.
46   * 
47   *           <html:p>
48   *           On mobile devices a list linking to each frame is rendered.
49   *           </html:p>
50   *
51   * <h4>Events:</h4>
52   * <table border="1" width="100%" cellpadding="3" summary="">
53   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
54   * <th align="left">Type</th>
55   * <th align="left">Phases</th>
56   * <th align="left">Description</th>
57   * </tr>
58   * <tr class="TableRowColor">
59   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
60   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
61   * <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>
62   * </tr>
63   * </table>
64   */
65  public class HtmlFrameBorderLayout extends UIXComponentBase
66                                     implements ClientBehaviorHolder
67  {
68    static public final FacesBean.Type TYPE = new FacesBean.Type(
69      UIXComponentBase.TYPE);
70    static public final PropertyKey ONLOAD_KEY =
71      TYPE.registerKey("onload", String.class);
72    static public final PropertyKey ONUNLOAD_KEY =
73      TYPE.registerKey("onunload", String.class);
74    static public final PropertyKey WIDTH_KEY =
75      TYPE.registerKey("width", String.class);
76    static public final PropertyKey HEIGHT_KEY =
77      TYPE.registerKey("height", String.class);
78    static public final PropertyKey FRAME_SPACING_KEY =
79      TYPE.registerKey("frameSpacing", Integer.class);
80    static public final PropertyKey BORDER_WIDTH_KEY =
81      TYPE.registerKey("borderWidth", Integer.class);
82    static public final PropertyKey FRAME_BORDER_WIDTH_KEY =
83      TYPE.registerKey("frameBorderWidth", Integer.class);
84    static public final PropertyKey SHORT_DESC_KEY =
85      TYPE.registerKey("shortDesc", String.class);
86    static public final PropertyKey PARTIAL_TRIGGERS_KEY =
87      TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
88    static public final PropertyKey STYLE_CLASS_KEY =
89      TYPE.registerKey("styleClass", String.class);
90    static public final PropertyKey INLINE_STYLE_KEY =
91      TYPE.registerKey("inlineStyle", String.class);
92    static public final String CENTER_FACET = "center";
93    static public final String TOP_FACET = "top";
94    static public final String BOTTOM_FACET = "bottom";
95    static public final String LEFT_FACET = "left";
96    static public final String RIGHT_FACET = "right";
97    static public final String START_FACET = "start";
98    static public final String END_FACET = "end";
99    static public final String INNER_LEFT_FACET = "innerLeft";
100   static public final String INNER_RIGHT_FACET = "innerRight";
101   static public final String INNER_START_FACET = "innerStart";
102   static public final String INNER_END_FACET = "innerEnd";
103   static public final String ALTERNATE_CONTENT_FACET = "alternateContent";
104 
105   static public final String COMPONENT_FAMILY =
106     "org.apache.myfaces.trinidad.FrameBorderLayout";
107   static public final String COMPONENT_TYPE =
108     "org.apache.myfaces.trinidad.HtmlFrameBorderLayout";
109   // Supported client events for client behaviors:
110   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
111     Arrays.asList(
112       "load", "unload"
113     ));
114 
115   /**
116    * Construct an instance of the HtmlFrameBorderLayout.
117    */
118   public HtmlFrameBorderLayout()
119   {
120     super("org.apache.myfaces.trinidad.FrameBorderLayout");
121   }
122 
123   /**
124    * The frame to be rendered in the center.
125    */
126   final public UIComponent getCenter()
127   {
128     return getFacet(CENTER_FACET);
129   }
130 
131   /**
132    * The frame to be rendered in the center.
133    */
134   @SuppressWarnings("unchecked")
135   final public void setCenter(UIComponent centerFacet)
136   {
137     getFacets().put(CENTER_FACET, centerFacet);
138   }
139 
140   /**
141    * The frame to be rendered above the center frame.
142    *                 This frame's height attribute is used to allocate
143    *                 its height.
144    */
145   final public UIComponent getTop()
146   {
147     return getFacet(TOP_FACET);
148   }
149 
150   /**
151    * The frame to be rendered above the center frame.
152    *                 This frame's height attribute is used to allocate
153    *                 its height.
154    */
155   @SuppressWarnings("unchecked")
156   final public void setTop(UIComponent topFacet)
157   {
158     getFacets().put(TOP_FACET, topFacet);
159   }
160 
161   /**
162    * The frame to be rendered below the center frame.
163    *                 This frame's height attribute is used to allocate
164    *                 its height.
165    */
166   final public UIComponent getBottom()
167   {
168     return getFacet(BOTTOM_FACET);
169   }
170 
171   /**
172    * The frame to be rendered below the center frame.
173    *                 This frame's height attribute is used to allocate
174    *                 its height.
175    */
176   @SuppressWarnings("unchecked")
177   final public void setBottom(UIComponent bottomFacet)
178   {
179     getFacets().put(BOTTOM_FACET, bottomFacet);
180   }
181 
182   /**
183    * The frame to be rendered to the left of the center frame.
184    *                 This frame's width attribute is used to allocate
185    *                 its width.
186    */
187   final public UIComponent getLeft()
188   {
189     return getFacet(LEFT_FACET);
190   }
191 
192   /**
193    * The frame to be rendered to the left of the center frame.
194    *                 This frame's width attribute is used to allocate
195    *                 its width.
196    */
197   @SuppressWarnings("unchecked")
198   final public void setLeft(UIComponent leftFacet)
199   {
200     getFacets().put(LEFT_FACET, leftFacet);
201   }
202 
203   /**
204    * The frame to be rendered to the right of the center frame.
205    *                 This frame's width attribute is used to allocate
206    *                 its width.
207    */
208   final public UIComponent getRight()
209   {
210     return getFacet(RIGHT_FACET);
211   }
212 
213   /**
214    * The frame to be rendered to the right of the center frame.
215    *                 This frame's width attribute is used to allocate
216    *                 its width.
217    */
218   @SuppressWarnings("unchecked")
219   final public void setRight(UIComponent rightFacet)
220   {
221     getFacets().put(RIGHT_FACET, rightFacet);
222   }
223 
224   /**
225    * The frame to be rendered to the left of the center frame,
226    *                 if the
227    *                 reading direction is left-to-right, or right otherwise.
228    *                 This frame's width attribute is used to allocate
229    *                 its width.
230    */
231   final public UIComponent getStart()
232   {
233     return getFacet(START_FACET);
234   }
235 
236   /**
237    * The frame to be rendered to the left of the center frame,
238    *                 if the
239    *                 reading direction is left-to-right, or right otherwise.
240    *                 This frame's width attribute is used to allocate
241    *                 its width.
242    */
243   @SuppressWarnings("unchecked")
244   final public void setStart(UIComponent startFacet)
245   {
246     getFacets().put(START_FACET, startFacet);
247   }
248 
249   /**
250    * The frame to be rendered to the right of the center frame,
251    *                 if the
252    *                 reading direction is left-to-right, or left otherwise.
253    *                 This frame's width attribute is used to allocate
254    *                 its width.
255    */
256   final public UIComponent getEnd()
257   {
258     return getFacet(END_FACET);
259   }
260 
261   /**
262    * The frame to be rendered to the right of the center frame,
263    *                 if the
264    *                 reading direction is left-to-right, or left otherwise.
265    *                 This frame's width attribute is used to allocate
266    *                 its width.
267    */
268   @SuppressWarnings("unchecked")
269   final public void setEnd(UIComponent endFacet)
270   {
271     getFacets().put(END_FACET, endFacet);
272   }
273 
274   /**
275    * The frame to be rendered between the left frame and
276    *                 the center frame.
277    *                 This frame's width attribute is used to allocate
278    *                 its width.
279    */
280   final public UIComponent getInnerLeft()
281   {
282     return getFacet(INNER_LEFT_FACET);
283   }
284 
285   /**
286    * The frame to be rendered between the left frame and
287    *                 the center frame.
288    *                 This frame's width attribute is used to allocate
289    *                 its width.
290    */
291   @SuppressWarnings("unchecked")
292   final public void setInnerLeft(UIComponent innerLeftFacet)
293   {
294     getFacets().put(INNER_LEFT_FACET, innerLeftFacet);
295   }
296 
297   /**
298    * The frame to be rendered between the right frame and
299    *                 the center frame.
300    *                 This frame's width attribute is used to allocate
301    *                 its width.
302    */
303   final public UIComponent getInnerRight()
304   {
305     return getFacet(INNER_RIGHT_FACET);
306   }
307 
308   /**
309    * The frame to be rendered between the right frame and
310    *                 the center frame.
311    *                 This frame's width attribute is used to allocate
312    *                 its width.
313    */
314   @SuppressWarnings("unchecked")
315   final public void setInnerRight(UIComponent innerRightFacet)
316   {
317     getFacets().put(INNER_RIGHT_FACET, innerRightFacet);
318   }
319 
320   /**
321    * The frame to be rendered as the innerLeft frame,
322    *                 if the reading direction is left-to-right,
323    *                 or innerRight frame otherwise.
324    *                 This frame's width attribute is used to allocate
325    *                 its width.
326    */
327   final public UIComponent getInnerStart()
328   {
329     return getFacet(INNER_START_FACET);
330   }
331 
332   /**
333    * The frame to be rendered as the innerLeft frame,
334    *                 if the reading direction is left-to-right,
335    *                 or innerRight frame otherwise.
336    *                 This frame's width attribute is used to allocate
337    *                 its width.
338    */
339   @SuppressWarnings("unchecked")
340   final public void setInnerStart(UIComponent innerStartFacet)
341   {
342     getFacets().put(INNER_START_FACET, innerStartFacet);
343   }
344 
345   /**
346    * The frame to be rendered as the innerRight frame,
347    *                 if the reading direction is left-to-right,
348    *                 or innerLeft frame otherwise.
349    *                 This frame's width attribute is used to allocate
350    *                 its width.
351    */
352   final public UIComponent getInnerEnd()
353   {
354     return getFacet(INNER_END_FACET);
355   }
356 
357   /**
358    * The frame to be rendered as the innerRight frame,
359    *                 if the reading direction is left-to-right,
360    *                 or innerLeft frame otherwise.
361    *                 This frame's width attribute is used to allocate
362    *                 its width.
363    */
364   @SuppressWarnings("unchecked")
365   final public void setInnerEnd(UIComponent innerEndFacet)
366   {
367     getFacets().put(INNER_END_FACET, innerEndFacet);
368   }
369 
370   /**
371    * These contents will be rendered inside HTML
372    *               <code>NOFRAMES</code> tags. Browsers that do not
373    *               support frames will render these contents.
374    */
375   final public UIComponent getAlternateContent()
376   {
377     return getFacet(ALTERNATE_CONTENT_FACET);
378   }
379 
380   /**
381    * These contents will be rendered inside HTML
382    *               <code>NOFRAMES</code> tags. Browsers that do not
383    *               support frames will render these contents.
384    */
385   @SuppressWarnings("unchecked")
386   final public void setAlternateContent(UIComponent alternateContentFacet)
387   {
388     getFacets().put(ALTERNATE_CONTENT_FACET, alternateContentFacet);
389   }
390 
391   /**
392    * Gets an onload Javascript handler.
393    *
394    * @return  the new onload value
395    */
396   final public String getOnload()
397   {
398     return ComponentUtils.resolveString(getProperty(ONLOAD_KEY));
399   }
400 
401   /**
402    * Sets an onload Javascript handler.
403    * 
404    * @param onload  the new onload value
405    */
406   final public void setOnload(String onload)
407   {
408     setProperty(ONLOAD_KEY, (onload));
409   }
410 
411   /**
412    * Gets an onunload Javascript handler.
413    *
414    * @return  the new onunload value
415    */
416   final public String getOnunload()
417   {
418     return ComponentUtils.resolveString(getProperty(ONUNLOAD_KEY));
419   }
420 
421   /**
422    * Sets an onunload Javascript handler.
423    * 
424    * @param onunload  the new onunload value
425    */
426   final public void setOnunload(String onunload)
427   {
428     setProperty(ONUNLOAD_KEY, (onunload));
429   }
430 
431   /**
432    * Gets The proposed width of this frameBorderLayout.  This can be in
433    *            pixels or percentage. This attribute is used only if this a nested
434    *            frameBorderLayout in a left/right facet of a
435    *            frameBorderLayout.
436    *
437    * @return  the new width value
438    */
439   final public String getWidth()
440   {
441     return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
442   }
443 
444   /**
445    * Sets The proposed width of this frameBorderLayout.  This can be in
446    *            pixels or percentage. This attribute is used only if this a nested
447    *            frameBorderLayout in a left/right facet of a
448    *            frameBorderLayout.
449    * 
450    * @param width  the new width value
451    */
452   final public void setWidth(String width)
453   {
454     setProperty(WIDTH_KEY, (width));
455   }
456 
457   /**
458    * Gets The proposed height of this frameBorderLayout.  This can be in
459    *            pixels or percentage. This attribute is used only if this a nested
460    *            frameBorderLayout in a top/bottom facet of a
461    *            frameBorderLayout.
462    *
463    * @return  the new height value
464    */
465   final public String getHeight()
466   {
467     return ComponentUtils.resolveString(getProperty(HEIGHT_KEY));
468   }
469 
470   /**
471    * Sets The proposed height of this frameBorderLayout.  This can be in
472    *            pixels or percentage. This attribute is used only if this a nested
473    *            frameBorderLayout in a top/bottom facet of a
474    *            frameBorderLayout.
475    * 
476    * @param height  the new height value
477    */
478   final public void setHeight(String height)
479   {
480     setProperty(HEIGHT_KEY, (height));
481   }
482 
483   /**
484    * Gets The size of frame spacing to be rendered.
485    *
486    * @return  the new frameSpacing value
487    */
488   final public int getFrameSpacing()
489   {
490     return ComponentUtils.resolveInteger(getProperty(FRAME_SPACING_KEY));
491   }
492 
493   /**
494    * Sets The size of frame spacing to be rendered.
495    * 
496    * @param frameSpacing  the new frameSpacing value
497    */
498   final public void setFrameSpacing(int frameSpacing)
499   {
500     setProperty(FRAME_SPACING_KEY, Integer.valueOf(frameSpacing));
501   }
502 
503   /**
504    * Gets The size for the border width to be rendered.
505    *
506    * @return  the new borderWidth value
507    */
508   final public int getBorderWidth()
509   {
510     return ComponentUtils.resolveInteger(getProperty(BORDER_WIDTH_KEY));
511   }
512 
513   /**
514    * Sets The size for the border width to be rendered.
515    * 
516    * @param borderWidth  the new borderWidth value
517    */
518   final public void setBorderWidth(int borderWidth)
519   {
520     setProperty(BORDER_WIDTH_KEY, Integer.valueOf(borderWidth));
521   }
522 
523   /**
524    * Gets The size for the frame border width to be rendered.
525    *
526    * @return  the new frameBorderWidth value
527    */
528   final public int getFrameBorderWidth()
529   {
530     return ComponentUtils.resolveInteger(getProperty(FRAME_BORDER_WIDTH_KEY));
531   }
532 
533   /**
534    * Sets The size for the frame border width to be rendered.
535    * 
536    * @param frameBorderWidth  the new frameBorderWidth value
537    */
538   final public void setFrameBorderWidth(int frameBorderWidth)
539   {
540     setProperty(FRAME_BORDER_WIDTH_KEY, Integer.valueOf(frameBorderWidth));
541   }
542 
543   /**
544    * Gets the short description of the bean.  This text
545    *          is commonly used by user agents to display tooltip help text.
546    *
547    * @return  the new shortDesc value
548    */
549   final public String getShortDesc()
550   {
551     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
552   }
553 
554   /**
555    * Sets the short description of the bean.  This text
556    *          is commonly used by user agents to display tooltip help text.
557    * 
558    * @param shortDesc  the new shortDesc value
559    */
560   final public void setShortDesc(String shortDesc)
561   {
562     setProperty(SHORT_DESC_KEY, (shortDesc));
563   }
564 
565   /**
566    * Gets the IDs of the components that should trigger a partial update.
567    *          This component will listen on the trigger components. If one of the
568    *          trigger components receives an event that will cause it to update
569    *          in some way, this component will request to be updated too.
570    *
571    * @return  the new partialTriggers value
572    */
573   final public String[] getPartialTriggers()
574   {
575     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
576   }
577 
578   /**
579    * Sets the IDs of the components that should trigger a partial update.
580    *          This component will listen on the trigger components. If one of the
581    *          trigger components receives an event that will cause it to update
582    *          in some way, this component will request to be updated too.
583    * 
584    * @param partialTriggers  the new partialTriggers value
585    */
586   final public void setPartialTriggers(String[] partialTriggers)
587   {
588     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
589   }
590 
591   /**
592    * Gets the CSS style class of the bean.
593    *
594    * @return  the new styleClass value
595    */
596   final public String getStyleClass()
597   {
598     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
599   }
600 
601   /**
602    * Sets the CSS style class of the bean.
603    * 
604    * @param styleClass  the new styleClass value
605    */
606   final public void setStyleClass(String styleClass)
607   {
608     setProperty(STYLE_CLASS_KEY, (styleClass));
609   }
610 
611   /**
612    * Gets the inline CSS style for this element
613    *
614    * @return  the new inlineStyle value
615    */
616   final public String getInlineStyle()
617   {
618     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
619   }
620 
621   /**
622    * Sets the inline CSS style for this element
623    * 
624    * @param inlineStyle  the new inlineStyle value
625    */
626   final public void setInlineStyle(String inlineStyle)
627   {
628     setProperty(INLINE_STYLE_KEY, (inlineStyle));
629   }
630 
631   @Override
632   public String getDefaultEventName()
633   {
634     return "load";
635   }
636 
637   @Override
638   public Collection<String> getEventNames()
639   {
640     return _EVENT_NAMES;
641   }
642 
643   @Override
644   public Map<String, List<ClientBehavior>> getClientBehaviors()
645   {
646     return super.getClientBehaviors();
647   }
648 
649   @Override
650   public void addClientBehavior(
651     String         eventName,
652     ClientBehavior behavior)
653   {
654     super.addClientBehavior(eventName, behavior);
655   }
656 
657   @Override
658   public String getFamily()
659   {
660     return COMPONENT_FAMILY;
661   }
662 
663   @Override
664   protected FacesBean.Type getBeanType()
665   {
666     return TYPE;
667   }
668 
669   /**
670    * Construct an instance of the HtmlFrameBorderLayout.
671    */
672   protected HtmlFrameBorderLayout(
673     String rendererType
674     )
675   {
676     super(rendererType);
677   }
678 
679   static
680   {
681     TYPE.lockAndRegister("org.apache.myfaces.trinidad.FrameBorderLayout","org.apache.myfaces.trinidad.FrameBorderLayout");
682   }
683 }