KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > faces > taglib > html > FormTag


1 /*
2  * Copyright 1999-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.cocoon.faces.taglib.html;
17
18 import org.apache.cocoon.faces.taglib.UIComponentTag;
19
20 import javax.faces.FacesException;
21 import javax.faces.component.UIComponent;
22 import javax.faces.component.UIForm;
23
24 /**
25  * @version CVS $Id: FormTag.java 46253 2004-09-17 14:36:29Z vgritsenko $
26  */

27 public class FormTag extends UIComponentTag {
28
29     private String JavaDoc accept;
30     private String JavaDoc acceptcharset;
31     private String JavaDoc dir;
32     private String JavaDoc enctype;
33     private String JavaDoc lang;
34     private String JavaDoc onclick;
35     private String JavaDoc ondblclick;
36     private String JavaDoc onkeydown;
37     private String JavaDoc onkeypress;
38     private String JavaDoc onkeyup;
39     private String JavaDoc onmousedown;
40     private String JavaDoc onmousemove;
41     private String JavaDoc onmouseout;
42     private String JavaDoc onmouseover;
43     private String JavaDoc onmouseup;
44     private String JavaDoc onreset;
45     private String JavaDoc onsubmit;
46     private String JavaDoc style;
47     private String JavaDoc styleClass;
48     private String JavaDoc target;
49     private String JavaDoc title;
50
51
52     public void setAccept(String JavaDoc accept) {
53         this.accept = accept;
54     }
55
56     public void setAcceptcharset(String JavaDoc acceptcharset) {
57         this.acceptcharset = acceptcharset;
58     }
59
60     public void setDir(String JavaDoc dir) {
61         this.dir = dir;
62     }
63
64     public void setEnctype(String JavaDoc enctype) {
65         this.enctype = enctype;
66     }
67
68     public void setLang(String JavaDoc lang) {
69         this.lang = lang;
70     }
71
72     public void setOnclick(String JavaDoc onclick) {
73         this.onclick = onclick;
74     }
75
76     public void setOndblclick(String JavaDoc ondblclick) {
77         this.ondblclick = ondblclick;
78     }
79
80     public void setOnkeydown(String JavaDoc onkeydown) {
81         this.onkeydown = onkeydown;
82     }
83
84     public void setOnkeypress(String JavaDoc onkeypress) {
85         this.onkeypress = onkeypress;
86     }
87
88     public void setOnkeyup(String JavaDoc onkeyup) {
89         this.onkeyup = onkeyup;
90     }
91
92     public void setOnmousedown(String JavaDoc onmousedown) {
93         this.onmousedown = onmousedown;
94     }
95
96     public void setOnmousemove(String JavaDoc onmousemove) {
97         this.onmousemove = onmousemove;
98     }
99
100     public void setOnmouseout(String JavaDoc onmouseout) {
101         this.onmouseout = onmouseout;
102     }
103
104     public void setOnmouseover(String JavaDoc onmouseover) {
105         this.onmouseover = onmouseover;
106     }
107
108     public void setOnmouseup(String JavaDoc onmouseup) {
109         this.onmouseup = onmouseup;
110     }
111
112     public void setOnreset(String JavaDoc onreset) {
113         this.onreset = onreset;
114     }
115
116     public void setOnsubmit(String JavaDoc onsubmit) {
117         this.onsubmit = onsubmit;
118     }
119
120     public void setStyle(String JavaDoc style) {
121         this.style = style;
122     }
123
124     public void setStyleClass(String JavaDoc styleClass) {
125         this.styleClass = styleClass;
126     }
127
128     public void setTarget(String JavaDoc target) {
129         this.target = target;
130     }
131
132     public void setTitle(String JavaDoc title) {
133         this.title = title;
134     }
135
136     public String JavaDoc getRendererType() {
137         return "javax.faces.Form";
138     }
139
140     public String JavaDoc getComponentType() {
141         return "javax.faces.HtmlForm";
142     }
143
144     protected void setProperties(UIComponent component) {
145         super.setProperties(component);
146
147         if (!(component instanceof UIForm)) {
148             throw new FacesException("Tag <" + getClass().getName() + "> expected UIForm. " +
149                                      "Got <" + component.getClass().getName() + ">");
150         }
151
152         setProperty(component, "accept", accept);
153         setProperty(component, "acceptcharset", acceptcharset);
154         setProperty(component, "dir", dir);
155         setProperty(component, "enctype", enctype);
156         setProperty(component, "lang", lang);
157         setProperty(component, "onclick", onclick);
158         setProperty(component, "ondblclick", ondblclick);
159         setProperty(component, "onkeydown", onkeydown);
160         setProperty(component, "onkeypress", onkeypress);
161         setProperty(component, "onkeyup", onkeyup);
162         setProperty(component, "onmousedown", onmousedown);
163         setProperty(component, "onmousemove", onmousemove);
164         setProperty(component, "onmouseout", onmouseout);
165         setProperty(component, "onmouseover", onmouseover);
166         setProperty(component, "onmouseup", onmouseup);
167         setProperty(component, "onreset", onreset);
168         setProperty(component, "onsubmit", onsubmit);
169         setProperty(component, "style", style);
170         setProperty(component, "styleClass", styleClass);
171         setProperty(component, "target", target);
172         setProperty(component, "title", title);
173     }
174
175     public void recycle() {
176         super.recycle();
177         accept = null;
178         acceptcharset = null;
179         dir = null;
180         enctype = null;
181         lang = null;
182         onclick = null;
183         ondblclick = null;
184         onkeydown = null;
185         onkeypress = null;
186         onkeyup = null;
187         onmousedown = null;
188         onmousemove = null;
189         onmouseout = null;
190         onmouseover = null;
191         onmouseup = null;
192         onreset = null;
193         onsubmit = null;
194         style = null;
195         styleClass = null;
196         target = null;
197         title = null;
198     }
199 }
200
Popular Tags