View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.taglib.html.ext;
20  
21  import org.apache.myfaces.shared_tomahawk.component.DisplayValueOnlyCapable;
22  import org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr;
23  import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlSelectOneRadioTagBase;
24  import org.apache.myfaces.component.UserRoleAware;
25  import org.apache.myfaces.component.html.ext.HtmlSelectOneRadio;
26  
27  import javax.faces.component.UIComponent;
28  
29  /**
30   * @author Manfred Geiler (latest modification by $Author: skitching $)
31   * @author Martin Marinschek
32   * @version $Revision: 673833 $ $Date: 2008-07-03 16:58:05 -0500 (Thu, 03 Jul 2008) $
33   */
34  public class HtmlSelectOneRadioTag
35          extends HtmlSelectOneRadioTagBase
36  {
37      public String getComponentType()
38      {
39          return HtmlSelectOneRadio.COMPONENT_TYPE;
40      }
41  
42      public String getRendererType()
43      {
44          return HtmlSelectOneRadio.DEFAULT_RENDERER_TYPE;
45      }
46  
47      private String _escape;
48      private String _enabledOnUserRole;
49      private String _visibleOnUserRole;
50  
51      private String _displayValueOnly;
52      private String _displayValueOnlyStyle;
53      private String _displayValueOnlyStyleClass;
54  
55      public void release() {
56          super.release();
57          _escape=null;
58          _enabledOnUserRole=null;
59          _visibleOnUserRole=null;
60  
61          _displayValueOnly=null;
62          _displayValueOnlyStyle=null;
63          _displayValueOnlyStyleClass=null;
64     }
65  
66      protected void setProperties(UIComponent component)
67      {
68          super.setProperties(component);
69          setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape);
70          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
71          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
72  
73          setBooleanProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_ATTR, _displayValueOnly);
74          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_ATTR, _displayValueOnlyStyle);
75          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR, _displayValueOnlyStyleClass);
76      }
77  
78      public void setEscape(String escape)
79      {
80          _escape = escape;
81      }
82  
83      public void setEnabledOnUserRole(String enabledOnUserRole)
84      {
85          _enabledOnUserRole = enabledOnUserRole;
86      }
87  
88      public void setVisibleOnUserRole(String visibleOnUserRole)
89      {
90          _visibleOnUserRole = visibleOnUserRole;
91      }
92  
93      public void setDisplayValueOnly(String displayValueOnly)
94      {
95          _displayValueOnly = displayValueOnly;
96      }
97  
98      public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
99      {
100         _displayValueOnlyStyle = displayValueOnlyStyle;
101     }
102 
103     public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
104     {
105         _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
106     }
107 }