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;
23  
24  import org.apache.myfaces.trinidad.bean.FacesBean;
25  import org.apache.myfaces.trinidad.bean.PropertyKey;
26  import org.apache.myfaces.trinidad.util.ComponentUtils;
27  
28  /**
29   *
30   * <h4>Events:</h4>
31   * <table border="1" width="100%" cellpadding="3" summary="">
32   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
33   * <th align="left">Type</th>
34   * <th align="left">Phases</th>
35   * <th align="left">Description</th>
36   * </tr>
37   * <tr class="TableRowColor">
38   * <td valign="top"><code>javax.faces.event.ValueChangeEvent</code></td>
39   * <td valign="top" nowrap>Process<br>Validations<br>Apply<br>Request<br>Values</td>
40   * <td valign="top">The valueChange event is delivered when the value
41                         attribute is changed.</td>
42   * </tr>
43   * <tr class="TableRowColor">
44   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
45   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
46   * <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>
47   * </tr>
48   * </table>
49   */
50  public class UIXSelectBoolean extends UIXEditableValue
51  {
52    static public final FacesBean.Type TYPE = new FacesBean.Type(
53      UIXEditableValue.TYPE);
54    static public final PropertyKey SELECTED_KEY =
55      TYPE.registerAlias(VALUE_KEY, "selected");
56    static public final String COMPONENT_FAMILY =
57      "org.apache.myfaces.trinidad.SelectBoolean";
58    static public final String COMPONENT_TYPE =
59      "org.apache.myfaces.trinidad.SelectBoolean";
60  
61    /**
62     * Construct an instance of the UIXSelectBoolean.
63     */
64    public UIXSelectBoolean()
65    {
66      super("org.apache.myfaces.trinidad.SelectBoolean");
67    }
68  
69    /**
70     * Gets whether or not the component is
71     *               currently selected.  This is a typesafe alias for the "value"
72     *               attribute. Note that "selected" and "value" attributes should not be used at the same time to avoid conflict.
73     *
74     * @return  the new selected value
75     */
76    final public boolean isSelected()
77    {
78      return ComponentUtils.resolveBoolean(getProperty(SELECTED_KEY), false);
79    }
80  
81    /**
82     * Sets whether or not the component is
83     *               currently selected.  This is a typesafe alias for the "value"
84     *               attribute. Note that "selected" and "value" attributes should not be used at the same time to avoid conflict.
85     * 
86     * @param selected  the new selected value
87     */
88    final public void setSelected(boolean selected)
89    {
90      setProperty(SELECTED_KEY, selected ? Boolean.TRUE : Boolean.FALSE);
91    }
92  
93    @Override
94    public String getFamily()
95    {
96      return COMPONENT_FAMILY;
97    }
98  
99    @Override
100   protected FacesBean.Type getBeanType()
101   {
102     return TYPE;
103   }
104 
105   /**
106    * Construct an instance of the UIXSelectBoolean.
107    */
108   protected UIXSelectBoolean(
109     String rendererType
110     )
111   {
112     super(rendererType);
113   }
114 
115   static
116   {
117     TYPE.lockAndRegister("org.apache.myfaces.trinidad.SelectBoolean","org.apache.myfaces.trinidad.SelectBoolean");
118   }
119 }