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.component.UserRoleAware;
22  import org.apache.myfaces.component.html.ext.HtmlOutputLabel;
23  import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlOutputLabelTagBase;
24  
25  import javax.faces.component.UIComponent;
26  
27  /**
28   * @author Manfred Geiler (latest modification by $Author: mkienenb $)
29   * @version $Revision: 523868 $ $Date: 2007-03-29 18:02:29 -0500 (Thu, 29 Mar 2007) $
30   */
31  public class HtmlOutputLabelTag
32          extends HtmlOutputLabelTagBase
33  {
34      public String getComponentType()
35      {
36          return HtmlOutputLabel.COMPONENT_TYPE;
37      }
38  
39      public String getRendererType()
40      {
41          return HtmlOutputLabel.DEFAULT_RENDERER_TYPE;
42      }
43  
44      private String _enabledOnUserRole;
45      private String _visibleOnUserRole;
46  
47      public void release() {
48          super.release();
49          _enabledOnUserRole=null;
50          _visibleOnUserRole=null;
51     }
52  
53      protected void setProperties(UIComponent component)
54      {
55          super.setProperties(component);
56          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
57          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
58      }
59  
60      public void setEnabledOnUserRole(String enabledOnUserRole)
61      {
62          _enabledOnUserRole = enabledOnUserRole;
63      }
64  
65      public void setVisibleOnUserRole(String visibleOnUserRole)
66      {
67          _visibleOnUserRole = visibleOnUserRole;
68      }
69  
70  }