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 javax.faces.context.FacesContext;
25  import org.apache.myfaces.trinidad.bean.FacesBean;
26  
27  /**
28   *
29   * UIXSelectOne is a base abstraction for 
30   *           components that allow selection of a single in a
31   *     series of selectItem components.
32   *           selectOne components may contain any number of
33   *           <f:selectItem>, <f:selectItems>, or
34   *     <tr:selectItem> components,  each of which
35   *           represents an available option that the user may select.
36   *
37   * <h4>Events:</h4>
38   * <table border="1" width="100%" cellpadding="3" summary="">
39   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
40   * <th align="left">Type</th>
41   * <th align="left">Phases</th>
42   * <th align="left">Description</th>
43   * </tr>
44   * <tr class="TableRowColor">
45   * <td valign="top"><code>javax.faces.event.ValueChangeEvent</code></td>
46   * <td valign="top" nowrap>Process<br>Validations<br>Apply<br>Request<br>Values</td>
47   * <td valign="top">The valueChange event is delivered when the value
48                         attribute is changed.</td>
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 UIXSelectOne extends UIXEditableValue
58  {
59    static public final FacesBean.Type TYPE = new FacesBean.Type(
60      UIXEditableValue.TYPE);
61  
62    static public final String COMPONENT_FAMILY =
63      "org.apache.myfaces.trinidad.SelectOne";
64    static public final String COMPONENT_TYPE =
65      "org.apache.myfaces.trinidad.SelectOne";
66  
67    /**
68     * Construct an instance of the UIXSelectOne.
69     */
70    public UIXSelectOne()
71    {
72      super("org.apache.myfaces.trinidad.Choice");
73    }
74    
75    static public final String REQUIRED_MESSAGE_ID =
76      "org.apache.myfaces.trinidad.UIXSelectOne.REQUIRED";
77  
78    // TODO walk through UIXSelectItem values to determine that the new
79    //       value is permitted
80    @Override
81    public void validateValue(FacesContext context, Object newValue)
82    {
83      super.validateValue(context, newValue);
84    }
85    
86    @Override
87    protected String getRequiredMessageKey()
88    {
89      return REQUIRED_MESSAGE_ID;
90    }    
91  
92    @Override
93    public String getFamily()
94    {
95      return COMPONENT_FAMILY;
96    }
97  
98    @Override
99    protected FacesBean.Type getBeanType()
100   {
101     return TYPE;
102   }
103 
104   /**
105    * Construct an instance of the UIXSelectOne.
106    */
107   protected UIXSelectOne(
108     String rendererType
109     )
110   {
111     super(rendererType);
112   }
113 
114   static
115   {
116     TYPE.lockAndRegister("org.apache.myfaces.trinidad.SelectOne","org.apache.myfaces.trinidad.Choice");
117   }
118 }