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.layout;
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.UIXPanel;
34  import org.apache.myfaces.trinidad.util.ComponentUtils;
35  
36  /**
37   *
38   * <html:p>
39   *   The panelBox is used to place ancillary information on a page,
40   *   offset by a certain color.
41   * </html:p>
42   * <html:p>
43   *   There are four possible attributes to set for the content container.
44   *   The width of the container can be set to either an exact pixel size or
45   *   a percentage of the element the content container is within.  This is
46   *   done by using the inlineStyle or styleClass attributes.
47   * </html:p>
48   * <html:p>
49   *   Content containers can have headers and icons.  Set the text and icon
50   *   attributes to gain these items.  If neither is set, the content
51   *   container will only display its children.  If there is a header but no
52   *   icon, the header will show and the content will be offset to line up with
53   *   the start of the header.  If an icon is set, the icon will appear to the
54   *   left of the header, but the content will still be offset to the left of the
55   *   header.  If an icon is set but no header, the icon will still be displayed
56   *   on the left but no header text will be visible.
57   * </html:p>
58   * <html:p>
59   *   Content containers can have various color schemes, which can be specified
60   *   by setting the background attribute.  The values for the background attribute
61   *   are light, medium, dark, and transparent.  The default is light.  Please note
62   *   that changing the background attribute may also change the appearance of the
63   *   title bar.
64   * </html:p>
65   * <html:p>
66   *   You can make changes to the style of the content region of this component by
67   *   adding your custom styles to the contentStyle attribute.
68   * </html:p>
69   * <html:p>
70   *   Content containers will generally have only one child with the actual
71   *   contents as its children. This child will describe how the content should be
72   *   displayed.  However, the content container can have multiple children, in
73   *   which case the children are displayed in a stack fashion, lined up
74   *   vertically.
75   * </html:p>
76   *
77   * <h4>Events:</h4>
78   * <table border="1" width="100%" cellpadding="3" summary="">
79   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
80   * <th align="left">Type</th>
81   * <th align="left">Phases</th>
82   * <th align="left">Description</th>
83   * </tr>
84   * <tr class="TableRowColor">
85   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
86   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
87   * <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>
88   * </tr>
89   * </table>
90   */
91  public class CorePanelBox extends UIXPanel
92                            implements ClientBehaviorHolder
93  {
94    static public final String BACKGROUND_LIGHT = "light";
95    static public final String BACKGROUND_MEDIUM = "medium";
96    static public final String BACKGROUND_DARK = "dark";
97    static public final String BACKGROUND_TRANSPARENT = "transparent";
98    static public final FacesBean.Type TYPE = new FacesBean.Type(
99      UIXPanel.TYPE);
100   static public final PropertyKey INLINE_STYLE_KEY =
101     TYPE.registerKey("inlineStyle", String.class);
102   static public final PropertyKey STYLE_CLASS_KEY =
103     TYPE.registerKey("styleClass", String.class);
104   static public final PropertyKey SHORT_DESC_KEY =
105     TYPE.registerKey("shortDesc", String.class);
106   static public final PropertyKey PARTIAL_TRIGGERS_KEY =
107     TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
108   static public final PropertyKey ONCLICK_KEY =
109     TYPE.registerKey("onclick", String.class);
110   static public final PropertyKey ONDBLCLICK_KEY =
111     TYPE.registerKey("ondblclick", String.class);
112   static public final PropertyKey ONMOUSEDOWN_KEY =
113     TYPE.registerKey("onmousedown", String.class);
114   static public final PropertyKey ONMOUSEUP_KEY =
115     TYPE.registerKey("onmouseup", String.class);
116   static public final PropertyKey ONMOUSEOVER_KEY =
117     TYPE.registerKey("onmouseover", String.class);
118   static public final PropertyKey ONMOUSEMOVE_KEY =
119     TYPE.registerKey("onmousemove", String.class);
120   static public final PropertyKey ONMOUSEOUT_KEY =
121     TYPE.registerKey("onmouseout", String.class);
122   static public final PropertyKey ONKEYPRESS_KEY =
123     TYPE.registerKey("onkeypress", String.class);
124   static public final PropertyKey ONKEYDOWN_KEY =
125     TYPE.registerKey("onkeydown", String.class);
126   static public final PropertyKey ONKEYUP_KEY =
127     TYPE.registerKey("onkeyup", String.class);
128   static public final PropertyKey TEXT_KEY =
129     TYPE.registerKey("text", String.class);
130   static public final PropertyKey BACKGROUND_KEY =
131     TYPE.registerKey("background", String.class, "light");
132   static public final PropertyKey ICON_KEY =
133     TYPE.registerKey("icon", String.class);
134   static public final PropertyKey CONTENT_STYLE_KEY =
135     TYPE.registerKey("contentStyle", String.class);
136 
137   static public final String COMPONENT_FAMILY =
138     "org.apache.myfaces.trinidad.Panel";
139   static public final String COMPONENT_TYPE =
140     "org.apache.myfaces.trinidad.CorePanelBox";
141   // Supported client events for client behaviors:
142   private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
143     Arrays.asList(
144       "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
145       "mouseout", "keypress", "keydown", "keyup"
146     ));
147 
148   /**
149    * Construct an instance of the CorePanelBox.
150    */
151   public CorePanelBox()
152   {
153     super("org.apache.myfaces.trinidad.Box");
154   }
155 
156   /**
157    * Gets the CSS styles to use for this component.
158    *
159    * @return  the new inlineStyle value
160    */
161   final public String getInlineStyle()
162   {
163     return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
164   }
165 
166   /**
167    * Sets the CSS styles to use for this component.
168    * 
169    * @param inlineStyle  the new inlineStyle value
170    */
171   final public void setInlineStyle(String inlineStyle)
172   {
173     setProperty(INLINE_STYLE_KEY, (inlineStyle));
174   }
175 
176   /**
177    * Gets a CSS style class to use for this component.
178    *
179    * @return  the new styleClass value
180    */
181   final public String getStyleClass()
182   {
183     return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
184   }
185 
186   /**
187    * Sets a CSS style class to use for this component.
188    * 
189    * @param styleClass  the new styleClass value
190    */
191   final public void setStyleClass(String styleClass)
192   {
193     setProperty(STYLE_CLASS_KEY, (styleClass));
194   }
195 
196   /**
197    * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
198    *
199    * @return  the new shortDesc value
200    */
201   final public String getShortDesc()
202   {
203     return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
204   }
205 
206   /**
207    * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
208    * 
209    * @param shortDesc  the new shortDesc value
210    */
211   final public void setShortDesc(String shortDesc)
212   {
213     setProperty(SHORT_DESC_KEY, (shortDesc));
214   }
215 
216   /**
217    * Gets the IDs of the components that should trigger a partial update.
218    *         <p>
219    *         This component will listen on the trigger components. If one of the
220    *         trigger components receives an event that will cause it to update
221    *         in some way, this component will request to be updated too.</p>
222    *         <p>
223    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
224    *         </p>
225    *         <p>
226    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
227    *         or use multiple colons to move up through the NamingContainer. For example,
228    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
229    *         ":::" will pop out of two naming containers, etc. The search for
230    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
231    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
232    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
233    *
234    * @return  the new partialTriggers value
235    */
236   final public String[] getPartialTriggers()
237   {
238     return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
239   }
240 
241   /**
242    * Sets the IDs of the components that should trigger a partial update.
243    *         <p>
244    *         This component will listen on the trigger components. If one of the
245    *         trigger components receives an event that will cause it to update
246    *         in some way, this component will request to be updated too.</p>
247    *         <p>
248    *         Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
249    *         </p>
250    *         <p>
251    *         Identifiers must account for NamingContainers.  You can use a single colon to start the search from the root,
252    *         or use multiple colons to move up through the NamingContainer. For example,
253    *         "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), 
254    *         ":::" will pop out of two naming containers, etc. The search for
255    *         the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the 
256    *         component with id = commandButton1 after popping out of two naming containers relative to this component.
257    *         To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
258    * 
259    * @param partialTriggers  the new partialTriggers value
260    */
261   final public void setPartialTriggers(String[] partialTriggers)
262   {
263     setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
264   }
265 
266   /**
267    * Gets an onclick Javascript handler.
268    *
269    * @return  the new onclick value
270    */
271   final public String getOnclick()
272   {
273     return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
274   }
275 
276   /**
277    * Sets an onclick Javascript handler.
278    * 
279    * @param onclick  the new onclick value
280    */
281   final public void setOnclick(String onclick)
282   {
283     setProperty(ONCLICK_KEY, (onclick));
284   }
285 
286   /**
287    * Gets an ondblclick Javascript handler.
288    *
289    * @return  the new ondblclick value
290    */
291   final public String getOndblclick()
292   {
293     return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
294   }
295 
296   /**
297    * Sets an ondblclick Javascript handler.
298    * 
299    * @param ondblclick  the new ondblclick value
300    */
301   final public void setOndblclick(String ondblclick)
302   {
303     setProperty(ONDBLCLICK_KEY, (ondblclick));
304   }
305 
306   /**
307    * Gets an onmousedown Javascript handler.
308    *
309    * @return  the new onmousedown value
310    */
311   final public String getOnmousedown()
312   {
313     return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
314   }
315 
316   /**
317    * Sets an onmousedown Javascript handler.
318    * 
319    * @param onmousedown  the new onmousedown value
320    */
321   final public void setOnmousedown(String onmousedown)
322   {
323     setProperty(ONMOUSEDOWN_KEY, (onmousedown));
324   }
325 
326   /**
327    * Gets an onmouseup Javascript handler.
328    *
329    * @return  the new onmouseup value
330    */
331   final public String getOnmouseup()
332   {
333     return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
334   }
335 
336   /**
337    * Sets an onmouseup Javascript handler.
338    * 
339    * @param onmouseup  the new onmouseup value
340    */
341   final public void setOnmouseup(String onmouseup)
342   {
343     setProperty(ONMOUSEUP_KEY, (onmouseup));
344   }
345 
346   /**
347    * Gets an onmouseover Javascript handler.
348    *
349    * @return  the new onmouseover value
350    */
351   final public String getOnmouseover()
352   {
353     return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
354   }
355 
356   /**
357    * Sets an onmouseover Javascript handler.
358    * 
359    * @param onmouseover  the new onmouseover value
360    */
361   final public void setOnmouseover(String onmouseover)
362   {
363     setProperty(ONMOUSEOVER_KEY, (onmouseover));
364   }
365 
366   /**
367    * Gets an onmousemove Javascript handler.
368    *
369    * @return  the new onmousemove value
370    */
371   final public String getOnmousemove()
372   {
373     return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
374   }
375 
376   /**
377    * Sets an onmousemove Javascript handler.
378    * 
379    * @param onmousemove  the new onmousemove value
380    */
381   final public void setOnmousemove(String onmousemove)
382   {
383     setProperty(ONMOUSEMOVE_KEY, (onmousemove));
384   }
385 
386   /**
387    * Gets an onmouseout Javascript handler.
388    *
389    * @return  the new onmouseout value
390    */
391   final public String getOnmouseout()
392   {
393     return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
394   }
395 
396   /**
397    * Sets an onmouseout Javascript handler.
398    * 
399    * @param onmouseout  the new onmouseout value
400    */
401   final public void setOnmouseout(String onmouseout)
402   {
403     setProperty(ONMOUSEOUT_KEY, (onmouseout));
404   }
405 
406   /**
407    * Gets an onkeypress Javascript handler.
408    *
409    * @return  the new onkeypress value
410    */
411   final public String getOnkeypress()
412   {
413     return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
414   }
415 
416   /**
417    * Sets an onkeypress Javascript handler.
418    * 
419    * @param onkeypress  the new onkeypress value
420    */
421   final public void setOnkeypress(String onkeypress)
422   {
423     setProperty(ONKEYPRESS_KEY, (onkeypress));
424   }
425 
426   /**
427    * Gets an onkeydown Javascript handler.
428    *
429    * @return  the new onkeydown value
430    */
431   final public String getOnkeydown()
432   {
433     return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
434   }
435 
436   /**
437    * Sets an onkeydown Javascript handler.
438    * 
439    * @param onkeydown  the new onkeydown value
440    */
441   final public void setOnkeydown(String onkeydown)
442   {
443     setProperty(ONKEYDOWN_KEY, (onkeydown));
444   }
445 
446   /**
447    * Gets an onkeyup Javascript handler.
448    *
449    * @return  the new onkeyup value
450    */
451   final public String getOnkeyup()
452   {
453     return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
454   }
455 
456   /**
457    * Sets an onkeyup Javascript handler.
458    * 
459    * @param onkeyup  the new onkeyup value
460    */
461   final public void setOnkeyup(String onkeyup)
462   {
463     setProperty(ONKEYUP_KEY, (onkeyup));
464   }
465 
466   /**
467    * Gets The header of the content container.
468    *
469    * @return  the new text value
470    */
471   final public String getText()
472   {
473     return ComponentUtils.resolveString(getProperty(TEXT_KEY));
474   }
475 
476   /**
477    * Sets The header of the content container.
478    * 
479    * @param text  the new text value
480    */
481   final public void setText(String text)
482   {
483     setProperty(TEXT_KEY, (text));
484   }
485 
486   /**
487    * Gets the appearance type of the content container. It should be one of "light",
488    * "medium", "dark", or "transparent"
489    *
490    * @return  the new background value
491    */
492   final public String getBackground()
493   {
494     return ComponentUtils.resolveString(getProperty(BACKGROUND_KEY), "light");
495   }
496 
497   /**
498    * Sets the appearance type of the content container. It should be one of "light",
499    * "medium", "dark", or "transparent"
500    * 
501    * @param background  the new background value
502    */
503   final public void setBackground(String background)
504   {
505     setProperty(BACKGROUND_KEY, (background));
506   }
507 
508   /**
509    * Gets An URL to an image to use for the icon of
510    * the content container.
511    *
512    * @return  the new icon value
513    */
514   final public String getIcon()
515   {
516     return ComponentUtils.resolveString(getProperty(ICON_KEY));
517   }
518 
519   /**
520    * Sets An URL to an image to use for the icon of
521    * the content container.
522    * 
523    * @param icon  the new icon value
524    */
525   final public void setIcon(String icon)
526   {
527     setProperty(ICON_KEY, (icon));
528   }
529 
530   /**
531    * Gets The inline style of the content region.
532    *
533    * @return  the new contentStyle value
534    */
535   final public String getContentStyle()
536   {
537     return ComponentUtils.resolveString(getProperty(CONTENT_STYLE_KEY));
538   }
539 
540   /**
541    * Sets The inline style of the content region.
542    * 
543    * @param contentStyle  the new contentStyle value
544    */
545   final public void setContentStyle(String contentStyle)
546   {
547     setProperty(CONTENT_STYLE_KEY, (contentStyle));
548   }
549 
550   @Override
551   public String getDefaultEventName()
552   {
553     return "click";
554   }
555 
556   @Override
557   public Collection<String> getEventNames()
558   {
559     return _EVENT_NAMES;
560   }
561 
562   @Override
563   public Map<String, List<ClientBehavior>> getClientBehaviors()
564   {
565     return super.getClientBehaviors();
566   }
567 
568   @Override
569   public void addClientBehavior(
570     String         eventName,
571     ClientBehavior behavior)
572   {
573     super.addClientBehavior(eventName, behavior);
574   }
575 
576   @Override
577   public String getFamily()
578   {
579     return COMPONENT_FAMILY;
580   }
581 
582   @Override
583   protected FacesBean.Type getBeanType()
584   {
585     return TYPE;
586   }
587 
588   /**
589    * Construct an instance of the CorePanelBox.
590    */
591   protected CorePanelBox(
592     String rendererType
593     )
594   {
595     super(rendererType);
596   }
597 
598   static
599   {
600     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Panel","org.apache.myfaces.trinidad.Box");
601   }
602 }