KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > ext > HtmlMessageTag


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.taglib.html.ext;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.component.html.ext.HtmlMessage;
20 import org.apache.myfaces.taglib.html.HtmlMessageTagBase;
21
22 import javax.faces.component.UIComponent;
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: matzew $)
26  * @version $Revision: 1.10 $ $Date: 2005/02/18 17:19:29 $
27  * $Log: HtmlMessageTag.java,v $
28  * Revision 1.10 2005/02/18 17:19:29 matzew
29  * added release() to tag clazzes.
30  *
31  * Revision 1.9 2005/01/22 19:47:44 mmarinschek
32  * Message rendering updated - if a validation exception needs to be rendered, the id of the component is replaced with a label.
33  *
34  * Revision 1.8 2004/10/13 11:50:59 matze
35  * renamed packages to org.apache
36  *
37  * Revision 1.7 2004/07/01 21:53:06 mwessendorf
38  * ASF switch
39  *
40  * Revision 1.6 2004/05/18 14:31:38 manolito
41  * user role support completely moved to components source tree
42  *
43  * Revision 1.5 2004/04/05 11:04:55 manolito
44  * setter for renderer type removed, no more default renderer type needed
45  *
46  * Revision 1.4 2004/04/01 12:57:42 manolito
47  * additional extended component classes for user role support
48  *
49  * Revision 1.3 2004/03/31 14:51:47 manolito
50  * summaryFormat and detailFormat support
51  *
52  * Revision 1.2 2004/03/30 17:47:32 manolito
53  * Message and Messages refactored
54  *
55  * Revision 1.1 2004/03/30 13:27:05 manolito
56  * extended Message component
57  *
58  */

59 public class HtmlMessageTag
60         extends HtmlMessageTagBase
61 {
62     //private static final Log log = LogFactory.getLog(HtmlOutputFormatTag.class);
63

64     public String JavaDoc getComponentType()
65     {
66         return HtmlMessage.COMPONENT_TYPE;
67     }
68
69     public String JavaDoc getRendererType()
70     {
71         return "org.apache.myfaces.Message";
72     }
73
74     private String JavaDoc _summaryFormat;
75     private String JavaDoc _detailFormat;
76     private String JavaDoc _enabledOnUserRole;
77     private String JavaDoc _visibleOnUserRole;
78     private String JavaDoc _replaceIdWithLabel;
79
80     public void release() {
81         super.release();
82
83         _summaryFormat = null;
84         _detailFormat = null;
85         _enabledOnUserRole = null;
86         _visibleOnUserRole = null;
87         _replaceIdWithLabel = null;
88     }
89     protected void setProperties(UIComponent component)
90     {
91         super.setProperties(component);
92
93         setStringProperty(component, "summaryFormat", _summaryFormat);
94         setStringProperty(component, "detailFormat", _detailFormat);
95         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
96         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
97         setBooleanProperty(component, "replaceIdWithLabel",_replaceIdWithLabel==null?Boolean.TRUE.toString():_replaceIdWithLabel);
98     }
99
100     public void setSummaryFormat(String JavaDoc summaryFormat)
101     {
102         _summaryFormat = summaryFormat;
103     }
104
105     public void setDetailFormat(String JavaDoc detailFormat)
106     {
107         _detailFormat = detailFormat;
108     }
109
110     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
111     {
112         _enabledOnUserRole = enabledOnUserRole;
113     }
114
115     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
116     {
117         _visibleOnUserRole = visibleOnUserRole;
118     }
119
120     public void setReplaceIdWithLabel(String JavaDoc replaceIdWithLabel)
121     {
122         _replaceIdWithLabel = replaceIdWithLabel;
123     }
124 }
125
Popular Tags