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.shared_orchestra.taglib.html;
20  
21  import org.apache.myfaces.shared_orchestra.renderkit.JSFAttr;
22  
23  import javax.faces.component.UIComponent;
24  
25  /**
26   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
27   * @version $Revision: 472630 $ $Date: 2006-11-08 15:40:03 -0500 (Wed, 08 Nov 2006) $
28   */
29  public abstract class HtmlMessageTagBase
30          extends org.apache.myfaces.shared_orchestra.taglib.html.HtmlComponentTagBase
31  {
32      //private static final Log log = LogFactory.getLog(HtmlOutputFormatTag.class);
33  
34      // UIComponent attributes --> already implemented in UIComponentTagBase
35  
36      // user role attributes --> already implemented in UIComponentTagBase
37  
38      // HTML universal attributes --> already implemented in HtmlComponentTagBase
39  
40      // HTML event handler attributes --> already implemented in HtmlComponentTagBase
41  
42      // UIMessage attributes
43      private String _for;
44      private String _showSummary;
45      private String _showDetail;
46  
47      // HtmlOutputMessage attributes
48      private String _infoClass;
49      private String _infoStyle;
50      private String _warnClass;
51      private String _warnStyle;
52      private String _errorClass;
53      private String _errorStyle;
54      private String _fatalClass;
55      private String _fatalStyle;
56      private String _tooltip;
57  
58      public void release() {
59          super.release();
60          _for=null;
61          _showSummary=null;
62          _showDetail=null;
63          _infoClass=null;
64          _infoStyle=null;
65          _warnClass=null;
66          _warnStyle=null;
67          _errorClass=null;
68          _errorStyle=null;
69          _fatalClass=null;
70          _fatalStyle=null;
71          _tooltip=null;
72      }
73  
74      protected void setProperties(UIComponent component)
75      {
76          super.setProperties(component);
77  
78          setStringProperty(component, JSFAttr.FOR_ATTR, _for);
79          setBooleanProperty(component, JSFAttr.SHOW_SUMMARY_ATTR, _showSummary);
80          setBooleanProperty(component, JSFAttr.SHOW_DETAIL_ATTR, _showDetail);
81  
82          setStringProperty(component, JSFAttr.INFO_CLASS_ATTR, _infoClass);
83          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.INFO_STYLE_ATTR, _infoStyle);
84          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.WARN_CLASS_ATTR, _warnClass);
85          setStringProperty(component, JSFAttr.WARN_STYLE_ATTR, _warnStyle);
86          setStringProperty(component, JSFAttr.ERROR_CLASS_ATTR, _errorClass);
87          setStringProperty(component, JSFAttr.ERROR_STYLE_ATTR, _errorStyle);
88          setStringProperty(component, JSFAttr.FATAL_CLASS_ATTR, _fatalClass);
89          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.FATAL_STYLE_ATTR, _fatalStyle);
90          setBooleanProperty(component, JSFAttr.TOOLTIP_ATTR, _tooltip);
91      }
92  
93      public void setFor(String aFor)
94      {
95          _for = aFor;
96      }
97  
98      public String getFor()
99      {
100         return _for;
101     }
102 
103     public void setShowSummary(String showSummary)
104     {
105         _showSummary = showSummary;
106     }
107 
108     public void setShowDetail(String showDetail)
109     {
110         _showDetail = showDetail;
111     }
112 
113     public void setErrorClass(String errorClass)
114     {
115         _errorClass = errorClass;
116     }
117 
118     public void setErrorStyle(String errorStyle)
119     {
120         _errorStyle = errorStyle;
121     }
122 
123     public void setFatalClass(String fatalClass)
124     {
125         _fatalClass = fatalClass;
126     }
127 
128     public void setFatalStyle(String fatalStyle)
129     {
130         _fatalStyle = fatalStyle;
131     }
132 
133     public void setInfoClass(String infoClass)
134     {
135         _infoClass = infoClass;
136     }
137 
138     public void setInfoStyle(String infoStyle)
139     {
140         _infoStyle = infoStyle;
141     }
142 
143     public void setWarnClass(String warnClass)
144     {
145         _warnClass = warnClass;
146     }
147 
148     public void setWarnStyle(String warnStyle)
149     {
150         _warnStyle = warnStyle;
151     }
152 
153     public void setTooltip(String tooltip)
154     {
155         _tooltip = tooltip;
156     }
157 }