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.taglib.html.HtmlPanelGridTagBase;
23  import org.apache.myfaces.component.UserRoleAware;
24  import org.apache.myfaces.component.html.ext.HtmlPanelGrid;
25  
26  import javax.faces.component.UIComponent;
27  
28  /**
29   * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
30   * @version $Revision: 170213 $ $Date: 2005-05-15 13:22:56 +0200 (Sun, 15 May 2005) $
31   */
32  public class HtmlPanelGridTag
33          extends HtmlPanelGridTagBase
34  {
35      public String getComponentType()
36      {
37          return HtmlPanelGrid.COMPONENT_TYPE;
38      }
39  
40      public String getRendererType()
41      {
42          return HtmlPanelGrid.DEFAULT_RENDERER_TYPE;
43      }
44  
45      private String _enabledOnUserRole;
46      private String _visibleOnUserRole;
47  
48      private String _displayValueOnly;
49      private String _displayValueOnlyStyle;
50      private String _displayValueOnlyStyleClass;
51  
52      public void release() {
53          super.release();
54          _enabledOnUserRole=null;
55          _visibleOnUserRole=null;
56          _displayValueOnly = null;
57          _displayValueOnlyStyle = null;
58          _displayValueOnlyStyleClass = null;
59     }
60  
61      protected void setProperties(UIComponent component)
62      {
63          super.setProperties(component);
64          setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
65          setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
66  
67          setBooleanProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_ATTR, _displayValueOnly);
68          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_ATTR, _displayValueOnlyStyle);
69          setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR, _displayValueOnlyStyleClass);
70      }
71  
72      public void setEnabledOnUserRole(String enabledOnUserRole)
73      {
74          _enabledOnUserRole = enabledOnUserRole;
75      }
76  
77      public void setVisibleOnUserRole(String visibleOnUserRole)
78      {
79          _visibleOnUserRole = visibleOnUserRole;
80      }
81  
82      public void setDisplayValueOnly(String displayValueOnly)
83      {
84          _displayValueOnly = displayValueOnly;
85      }
86  
87      public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
88      {
89          _displayValueOnlyStyle = displayValueOnlyStyle;
90      }
91  
92      public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
93      {
94          _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
95      }
96  
97  }