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.renderkit.html.HTML;
22  import org.apache.myfaces.shared_tomahawk.component.DisplayValueOnlyCapable;
23  import org.apache.myfaces.component.UserRoleAware;
24  import org.apache.myfaces.component.html.ext.HtmlInputText;
25  import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlInputTextTagBase;
26  
27  import javax.faces.component.UIComponent;
28  
29  /**
30   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
31   * @version $Revision: 472792 $ $Date: 2006-11-09 01:34:47 -0500 (Thu, 09 Nov 2006) $
32   */
33  public class HtmlInputTextTag
34          extends HtmlInputTextTagBase
35  {
36      public String getComponentType()
37      {
38          return HtmlInputText.COMPONENT_TYPE;
39      }
40  
41      public String getRendererType()
42      {
43          return HtmlInputText.DEFAULT_RENDERER_TYPE;
44      }
45  
46      private String _autocomplete;
47      private String _enabledOnUserRole;
48      private String _visibleOnUserRole;
49      private String _datafld;
50      private String _datasrc;
51      private String _dataformatas;
52      private String _disabledOnClientSide;
53  
54      private String _displayValueOnly;
55      private String _displayValueOnlyStyle;
56      private String _displayValueOnlyStyleClass;
57  
58      public void release() {
59          super.release();
60  
61          _autocomplete = null;
62          _enabledOnUserRole=null;
63          _visibleOnUserRole=null;
64          _datafld=null;
65          _datasrc=null;
66          _dataformatas=null;
67          _disabledOnClientSide=null;
68          _displayValueOnly=null;
69          _displayValueOnlyStyle=null;
70          _displayValueOnlyStyleClass=null;
71      }
72  
73      protected void setProperties(UIComponent component)
74      {
75          super.setProperties(component);
76          setStringProperty(component, HTML.AUTOCOMPLETE_ATTR, _autocomplete);
77          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
78          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
79          setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
80          setStringProperty(component, HTML.DATASRC_ATTR, _datasrc);
81          setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
82          setBooleanProperty(component, "disabledOnClientSide", _disabledOnClientSide);
83          setBooleanProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_ATTR, _displayValueOnly);
84          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_ATTR, _displayValueOnlyStyle);
85          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR, _displayValueOnlyStyleClass);
86      }
87  
88      public void setAutocomplete(String autocomplete)
89      {
90          _autocomplete = autocomplete;
91      }
92  
93      public void setEnabledOnUserRole(String enabledOnUserRole)
94      {
95          _enabledOnUserRole = enabledOnUserRole;
96      }
97  
98      public void setVisibleOnUserRole(String visibleOnUserRole)
99      {
100         _visibleOnUserRole = visibleOnUserRole;
101     }
102 
103     public void setDisplayValueOnly(String displayValueOnly)
104     {
105         _displayValueOnly = displayValueOnly;
106     }
107 
108     public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
109     {
110         _displayValueOnlyStyle = displayValueOnlyStyle;
111     }
112 
113     public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
114     {
115         _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
116     }
117     
118     public void setDatafld(String datafld)
119     {
120         _datafld = datafld;
121     }
122 
123     public void setDatasrc(String datasrc)
124     {
125         _datasrc = datasrc;
126     }
127 
128     public void setDataformatas(String dataformatas)
129     {
130         _dataformatas = dataformatas;
131     }
132     
133     public void setDisabledOnClientSide(String disabledOnClientSide)
134     {
135         _disabledOnClientSide = disabledOnClientSide;
136     }
137 }