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.renderkit.html.HTML;
24  import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlGraphicImageTagBase;
25  import org.apache.myfaces.component.UserRoleAware;
26  import org.apache.myfaces.component.html.ext.HtmlGraphicImage;
27  
28  /**
29   * @author Bruno Aranda
30   * @version $Revision$ $Date: 2005-05-11 18:45:06 +0200 (Wed, 11 May 2005) $
31   */
32  public class HtmlGraphicImageTag
33          extends HtmlGraphicImageTagBase
34  {
35      public String getComponentType()
36      {
37          return HtmlGraphicImage.COMPONENT_TYPE;
38      }
39  
40      public String getRendererType()
41      {
42          return HtmlGraphicImage.DEFAULT_RENDERER_TYPE;
43      }
44  
45      private String _align;
46      private String _border;
47      private String _enabledOnUserRole;
48      private String _hspace;
49      private String _visibleOnUserRole;
50      private String _vspace;
51  
52      public void release() {
53          super.release();
54  
55          _align=null;
56          _border=null;
57          _enabledOnUserRole=null;
58          _hspace=null;
59          _visibleOnUserRole=null;
60          _vspace=null;
61     }
62  
63      protected void setProperties(UIComponent component)
64      {
65          super.setProperties(component);
66  
67          setStringProperty(component, HTML.ALIGN_ATTR, _align);
68          setStringProperty(component, HTML.BORDER_ATTR, _border);
69          setStringProperty(component, HTML.HSPACE_ATTR, _hspace);
70          setStringProperty(component, HTML.VSPACE_ATTR, _vspace);
71          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
72          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
73      }
74  
75      public void setAlign(String align)
76      {
77          _align = align;
78      }
79  
80      public void setBorder(String border)
81      {
82          _border = border;
83      }
84  
85      public void setHspace(String hspace)
86      {
87          _hspace = hspace;
88      }
89  
90      public void setVspace(String vspace)
91      {
92          _vspace = vspace;
93      }
94  
95      public void setEnabledOnUserRole(String enabledOnUserRole)
96      {
97          _enabledOnUserRole = enabledOnUserRole;
98      }
99  
100     public void setVisibleOnUserRole(String visibleOnUserRole)
101     {
102         _visibleOnUserRole = visibleOnUserRole;
103     }
104 
105 }