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 javax.faces.component.UIComponent;
22  
23  import org.apache.myfaces.shared_tomahawk.component.DisplayValueOnlyCapable;
24  import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
25  import org.apache.myfaces.component.UserRoleAware;
26  import org.apache.myfaces.component.html.ext.HtmlInputSecret;
27  import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlInputSecretTagBase;
28  
29  /**
30   * @author Bruno Aranda 
31   * @version $Revision$ $Date: 2005-06-05 13:08:33 +0200 (Sun, 5 Jun 2005) $
32   */
33  public class HtmlInputSecretTag
34          extends HtmlInputSecretTagBase
35  {
36      public String getComponentType()
37      {
38          return HtmlInputSecret.COMPONENT_TYPE;
39      }
40  
41      public String getRendererType()
42      {
43          return HtmlInputSecret.DEFAULT_RENDERER_TYPE;
44      }
45  
46      private String _enabledOnUserRole;
47      private String _visibleOnUserRole;
48      private String _datafld;
49      private String _datasrc;
50      private String _dataformatas;
51  
52      private String _displayValueOnly;
53      private String _displayValueOnlyStyle;
54      private String _displayValueOnlyStyleClass;
55  
56      public void release() {
57          super.release();
58  
59          _enabledOnUserRole=null;
60          _visibleOnUserRole=null;
61          _datafld=null;
62          _datasrc=null;
63          _dataformatas=null;
64          _displayValueOnly=null;
65          _displayValueOnlyStyle=null;
66          _displayValueOnlyStyleClass=null;
67      }
68  
69      protected void setProperties(UIComponent component)
70      {
71          super.setProperties(component);
72          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
73          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
74          setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
75          setStringProperty(component, HTML.DATASRC_ATTR, _datasrc);
76          setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
77          setBooleanProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_ATTR, _displayValueOnly);
78          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_ATTR, _displayValueOnlyStyle);
79          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR, _displayValueOnlyStyleClass);
80      }
81  
82      public void setEnabledOnUserRole(String enabledOnUserRole)
83      {
84          _enabledOnUserRole = enabledOnUserRole;
85      }
86  
87      public void setVisibleOnUserRole(String visibleOnUserRole)
88      {
89          _visibleOnUserRole = visibleOnUserRole;
90      }
91  
92      public void setDisplayValueOnly(String displayValueOnly)
93      {
94          _displayValueOnly = displayValueOnly;
95      }
96  
97      public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
98      {
99          _displayValueOnlyStyle = displayValueOnlyStyle;
100     }
101 
102     public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
103     {
104         _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
105     }
106 
107     public void setDatafld(String datafld)
108     {
109         _datafld = datafld;
110     }
111 
112     public void setDatasrc(String datasrc)
113     {
114         _datasrc = datasrc;
115     }
116 
117     public void setDataformatas(String dataformatas)
118     {
119         _dataformatas = dataformatas;
120     }
121 }