001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.faces.taglib.html;
018:
019: import org.apache.cocoon.faces.taglib.UIComponentTag;
020:
021: import javax.faces.FacesException;
022: import javax.faces.component.UIComponent;
023: import javax.faces.component.UIForm;
024:
025: /**
026: * @version CVS $Id: FormTag.java 433543 2006-08-22 06:22:54Z crossley $
027: */
028: public class FormTag extends UIComponentTag {
029:
030: private String accept;
031: private String acceptcharset;
032: private String dir;
033: private String enctype;
034: private String lang;
035: private String onclick;
036: private String ondblclick;
037: private String onkeydown;
038: private String onkeypress;
039: private String onkeyup;
040: private String onmousedown;
041: private String onmousemove;
042: private String onmouseout;
043: private String onmouseover;
044: private String onmouseup;
045: private String onreset;
046: private String onsubmit;
047: private String style;
048: private String styleClass;
049: private String target;
050: private String title;
051:
052: public void setAccept(String accept) {
053: this .accept = accept;
054: }
055:
056: public void setAcceptcharset(String acceptcharset) {
057: this .acceptcharset = acceptcharset;
058: }
059:
060: public void setDir(String dir) {
061: this .dir = dir;
062: }
063:
064: public void setEnctype(String enctype) {
065: this .enctype = enctype;
066: }
067:
068: public void setLang(String lang) {
069: this .lang = lang;
070: }
071:
072: public void setOnclick(String onclick) {
073: this .onclick = onclick;
074: }
075:
076: public void setOndblclick(String ondblclick) {
077: this .ondblclick = ondblclick;
078: }
079:
080: public void setOnkeydown(String onkeydown) {
081: this .onkeydown = onkeydown;
082: }
083:
084: public void setOnkeypress(String onkeypress) {
085: this .onkeypress = onkeypress;
086: }
087:
088: public void setOnkeyup(String onkeyup) {
089: this .onkeyup = onkeyup;
090: }
091:
092: public void setOnmousedown(String onmousedown) {
093: this .onmousedown = onmousedown;
094: }
095:
096: public void setOnmousemove(String onmousemove) {
097: this .onmousemove = onmousemove;
098: }
099:
100: public void setOnmouseout(String onmouseout) {
101: this .onmouseout = onmouseout;
102: }
103:
104: public void setOnmouseover(String onmouseover) {
105: this .onmouseover = onmouseover;
106: }
107:
108: public void setOnmouseup(String onmouseup) {
109: this .onmouseup = onmouseup;
110: }
111:
112: public void setOnreset(String onreset) {
113: this .onreset = onreset;
114: }
115:
116: public void setOnsubmit(String onsubmit) {
117: this .onsubmit = onsubmit;
118: }
119:
120: public void setStyle(String style) {
121: this .style = style;
122: }
123:
124: public void setStyleClass(String styleClass) {
125: this .styleClass = styleClass;
126: }
127:
128: public void setTarget(String target) {
129: this .target = target;
130: }
131:
132: public void setTitle(String title) {
133: this .title = title;
134: }
135:
136: public String getRendererType() {
137: return "javax.faces.Form";
138: }
139:
140: public String 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()
149: + "> expected UIForm. " + "Got <"
150: + component.getClass().getName() + ">");
151: }
152:
153: setProperty(component, "accept", accept);
154: setProperty(component, "acceptcharset", acceptcharset);
155: setProperty(component, "dir", dir);
156: setProperty(component, "enctype", enctype);
157: setProperty(component, "lang", lang);
158: setProperty(component, "onclick", onclick);
159: setProperty(component, "ondblclick", ondblclick);
160: setProperty(component, "onkeydown", onkeydown);
161: setProperty(component, "onkeypress", onkeypress);
162: setProperty(component, "onkeyup", onkeyup);
163: setProperty(component, "onmousedown", onmousedown);
164: setProperty(component, "onmousemove", onmousemove);
165: setProperty(component, "onmouseout", onmouseout);
166: setProperty(component, "onmouseover", onmouseover);
167: setProperty(component, "onmouseup", onmouseup);
168: setProperty(component, "onreset", onreset);
169: setProperty(component, "onsubmit", onsubmit);
170: setProperty(component, "style", style);
171: setProperty(component, "styleClass", styleClass);
172: setProperty(component, "target", target);
173: setProperty(component, "title", title);
174: }
175:
176: public void recycle() {
177: super.recycle();
178: accept = null;
179: acceptcharset = null;
180: dir = null;
181: enctype = null;
182: lang = null;
183: onclick = null;
184: ondblclick = null;
185: onkeydown = null;
186: onkeypress = null;
187: onkeyup = null;
188: onmousedown = null;
189: onmousemove = null;
190: onmouseout = null;
191: onmouseover = null;
192: onmouseup = null;
193: onreset = null;
194: onsubmit = null;
195: style = null;
196: styleClass = null;
197: target = null;
198: title = null;
199: }
200: }
|