KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > inputHtml > InputHtmlTag


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.custom.inputHtml;
17
18 import javax.faces.component.UIComponent;
19
20 import org.apache.myfaces.component.UserRoleAware;
21 import org.apache.myfaces.renderkit.JSFAttr;
22 import org.apache.myfaces.taglib.UIComponentTagBase;
23
24 /**
25  * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
26  * @version $Revision: 1.1 $ $Date: 2005/03/26 20:31:37 $
27  * $Log: InputHtmlTag.java,v $
28  * Revision 1.1 2005/03/26 20:31:37 svieujot
29  * Rename x:htmlEditor to x:inputHtml.
30  *
31  * Revision 1.16 2005/03/22 02:13:28 svieujot
32  * htmlEditor : Add a showAllToolBoxes short cut.
33  *
34  * Revision 1.15 2005/03/18 15:38:15 svieujot
35  * Bugfix for weblogic.
36  *
37  * Revision 1.14 2005/03/15 05:24:03 svieujot
38  * Add a fallback textarea mode to the htmlEditor.
39  *
40  * Revision 1.13 2005/03/09 04:07:22 svieujot
41  * htmlEditor : Kupu 1.2rc2 update
42  *
43  * Revision 1.12 2005/02/18 17:19:30 matzew
44  * added release() to tag clazzes.
45  *
46  * Revision 1.11 2005/02/06 19:45:32 svieujot
47  * Add allowExternalLinks attribute.
48  *
49  * Revision 1.10 2005/02/05 18:51:21 svieujot
50  * x:htmlEditor : Upgrade to Kupu 1.2rc1, remove formularMode (too experimental), bugfixes.
51  *
52  * Revision 1.9 2005/01/02 20:39:16 svieujot
53  * HtmlEditor can now process HTML documents and HTML fragments.
54  *
55  * Revision 1.8 2004/12/10 02:16:26 svieujot
56  * Start implementing UserRoleAware.
57  *
58  * Revision 1.7 2004/12/08 04:36:27 svieujot
59  * Cancel last *source attributes, and make style and styleClass more modular.
60  *
61  * Revision 1.6 2004/12/08 04:13:56 svieujot
62  * Add styleSource and styleClassSource for the htmlEditor source window.
63  *
64  * Revision 1.5 2004/12/04 03:26:28 svieujot
65  * Various bug fixes
66  *
67  * Revision 1.4 2004/12/04 00:40:25 svieujot
68  * htmlEditor : add style and styleClass attributes.
69  *
70  * Revision 1.3 2004/12/04 00:20:00 svieujot
71  * htmlEditor : Add a formular mode, and more sensible defaults.
72  *
73  * Revision 1.2 2004/12/03 21:59:09 svieujot
74  * Initial set of htmlEditor attributes.
75  *
76  * Revision 1.1 2004/12/02 22:28:30 svieujot
77  * Add an x:htmlEditor based on the Kupu library.
78  */

79 public class InputHtmlTag extends UIComponentTagBase {
80     
81     private String JavaDoc style;
82     private String JavaDoc styleClass;
83
84     private String JavaDoc fallback;
85     private String JavaDoc type;
86     
87     private String JavaDoc allowEditSource;
88     private String JavaDoc allowExternalLinks;
89     private String JavaDoc addKupuLogo;
90
91     private String JavaDoc showAllToolBoxes;
92     private String JavaDoc showPropertiesToolBox;
93     private String JavaDoc showLinksToolBox;
94     private String JavaDoc showImagesToolBox;
95     private String JavaDoc showTablesToolBox;
96     private String JavaDoc showCleanupExpressionsToolBox;
97     private String JavaDoc showDebugToolBox;
98     
99     private String JavaDoc enabledOnUserRole;
100     private String JavaDoc visibleOnUserRole;
101     
102     private String JavaDoc immediate;
103     private String JavaDoc required;
104     private String JavaDoc validator;
105     private String JavaDoc valueChangeListener;
106     
107     public void release() {
108         super.release();
109         style=null;
110         styleClass=null;
111         fallback=null;
112         type=null;
113         allowEditSource=null;
114         allowExternalLinks=null;
115         addKupuLogo=null;
116         
117         showAllToolBoxes=null;
118         showPropertiesToolBox=null;
119         showLinksToolBox=null;
120         showImagesToolBox=null;
121         showTablesToolBox=null;
122         showCleanupExpressionsToolBox=null;
123         showDebugToolBox=null;
124         enabledOnUserRole=null;
125         visibleOnUserRole=null;
126         
127         immediate=null;
128         required=null;
129         validator=null;
130         valueChangeListener=null;
131     }
132     
133     protected void setProperties(UIComponent component) {
134         super.setProperties(component);
135         
136         setStringProperty(component, "style", style);
137         setStringProperty(component, "styleClass", styleClass);
138         
139         setStringProperty(component, "fallback", fallback);
140         setBooleanProperty(component, "type", type);
141         
142         setBooleanProperty(component, "allowEditSource", allowEditSource);
143         setBooleanProperty(component, "allowExternalLinks", allowExternalLinks);
144         setBooleanProperty(component, "addKupuLogo", addKupuLogo);
145         
146         setBooleanProperty(component, "showAllToolBoxes", showAllToolBoxes);
147         setBooleanProperty(component, "showPropertiesToolBox", showPropertiesToolBox);
148         setBooleanProperty(component, "showLinksToolBox", showLinksToolBox);
149         setBooleanProperty(component, "showImagesToolBox", showImagesToolBox);
150         setBooleanProperty(component, "showTablesToolBox", showTablesToolBox);
151         setBooleanProperty(component, "showCleanupExpressionsToolBox", showCleanupExpressionsToolBox);
152         setBooleanProperty(component, "showDebugToolBox", showDebugToolBox);
153         
154         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, enabledOnUserRole);
155         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, visibleOnUserRole);
156         
157         setBooleanProperty(component, JSFAttr.IMMEDIATE_ATTR, immediate);
158         setBooleanProperty(component, JSFAttr.REQUIRED_ATTR, required);
159         setValidatorProperty(component, validator);
160         setValueChangedListenerProperty(component, valueChangeListener);
161     }
162     
163     public String JavaDoc getComponentType() {
164         return InputHtml.COMPONENT_TYPE;
165     }
166
167     public String JavaDoc getRendererType() {
168         return InputHtml.DEFAULT_RENDERER_TYPE;
169     }
170
171     public void setStyle(String JavaDoc style){
172         this.style = style;
173     }
174     
175     public void setStyleClass(String JavaDoc styleClass){
176         this.styleClass = styleClass;
177     }
178     
179     public void setFallback(String JavaDoc fallback){
180         this.fallback = fallback;
181     }
182
183     public void setType(String JavaDoc type){
184         this.type = type;
185     }
186     
187     public void setAllowEditSource(String JavaDoc allowEditSource){
188         this.allowEditSource = allowEditSource;
189     }
190     
191     public void setAllowExternalLinks(String JavaDoc allowExternalLinks){
192         this.allowExternalLinks = allowExternalLinks;
193     }
194     
195     public void setAddKupuLogo(String JavaDoc addKupuLogo){
196         this.addKupuLogo = addKupuLogo;
197     }
198
199     public void setShowAllToolBoxes(String JavaDoc showAllToolBoxes){
200         this.showAllToolBoxes = showAllToolBoxes;
201     }
202
203     public void setShowPropertiesToolBox(String JavaDoc showPropertiesToolBox){
204         this.showPropertiesToolBox = showPropertiesToolBox;
205     }
206     
207     public void setShowLinksToolBox(String JavaDoc showLinksToolBox){
208         this.showLinksToolBox = showLinksToolBox;
209     }
210     
211     public void setShowImagesToolBox(String JavaDoc showImagesToolBox){
212         this.showImagesToolBox = showImagesToolBox;
213     }
214     
215     public void setShowTablesToolBox(String JavaDoc showTablesToolBox){
216         this.showTablesToolBox = showTablesToolBox;
217     }
218     
219     public void setShowCleanupExpressionsToolBox(String JavaDoc showCleanupExpressionsToolBox){
220         this.showCleanupExpressionsToolBox = showCleanupExpressionsToolBox;
221     }
222     
223     public void setShowDebugToolBox(String JavaDoc showDebugToolBox){
224         this.showDebugToolBox = showDebugToolBox;
225     }
226     
227     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole){
228         this.enabledOnUserRole = enabledOnUserRole;
229     }
230
231     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole){
232         this.visibleOnUserRole = visibleOnUserRole;
233     }
234     
235     public void setImmediate(String JavaDoc immediate){
236         this.immediate = immediate;
237     }
238
239     public void setRequired(String JavaDoc required){
240         this.required = required;
241     }
242
243     public void setValidator(String JavaDoc validator){
244         this.validator = validator;
245     }
246
247     public void setValueChangeListener(String JavaDoc valueChangeListener){
248         this.valueChangeListener = valueChangeListener;
249     }
250 }
Popular Tags