/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package renderkits.taglib.xul; import javax.faces.component.UIComponent; import javax.faces.webapp.UIComponentELTag; import javax.servlet.jsp.JspException; public final class FormTag extends UIComponentELTag { // Setter Methods // PROPERTY: prependId private javax.el.ValueExpression prependId; public void setPrependId(javax.el.ValueExpression prependId) { this.prependId = prependId; } // PROPERTY: accept private javax.el.ValueExpression accept; public void setAccept(javax.el.ValueExpression accept) { this.accept = accept; } // PROPERTY: acceptcharset private javax.el.ValueExpression acceptcharset; public void setAcceptcharset(javax.el.ValueExpression acceptcharset) { this.acceptcharset = acceptcharset; } // PROPERTY: enctype private javax.el.ValueExpression enctype; public void setEnctype(javax.el.ValueExpression enctype) { this.enctype = enctype; } // PROPERTY: onclick private javax.el.ValueExpression onclick; public void setOnclick(javax.el.ValueExpression onclick) { this.onclick = onclick; } // PROPERTY: onmousedown private javax.el.ValueExpression onmousedown; public void setOnmousedown(javax.el.ValueExpression onmousedown) { this.onmousedown = onmousedown; } // PROPERTY: onmousemove private javax.el.ValueExpression onmousemove; public void setOnmousemove(javax.el.ValueExpression onmousemove) { this.onmousemove = onmousemove; } // PROPERTY: onmouseout private javax.el.ValueExpression onmouseout; public void setOnmouseout(javax.el.ValueExpression onmouseout) { this.onmouseout = onmouseout; } // PROPERTY: onmouseover private javax.el.ValueExpression onmouseover; public void setOnmouseover(javax.el.ValueExpression onmouseover) { this.onmouseover = onmouseover; } // PROPERTY: onmouseup private javax.el.ValueExpression onmouseup; public void setOnmouseup(javax.el.ValueExpression onmouseup) { this.onmouseup = onmouseup; } // PROPERTY: style private javax.el.ValueExpression style; public void setStyle(javax.el.ValueExpression style) { this.style = style; } // General Methods public String getRendererType() { return "renderkit.xul.Form"; } public String getComponentType() { return "javax.faces.Form"; } protected void setProperties(UIComponent component) { super.setProperties(component); javax.faces.component.UIForm form = null; try { form = (javax.faces.component.UIForm) component; } catch (ClassCastException cce) { throw new IllegalStateException("Component " + component.toString() + " not expected type. Expected: javax.faces.component.UIForm. Perhaps you're missing a tag?"); } if (prependId != null) { if (!prependId.isLiteralText()) { form.setValueExpression("prependId", prependId); } else { form.setPrependId(java.lang.Boolean .valueOf(prependId.getExpressionString()).booleanValue()); } } if (accept != null) { if (!accept.isLiteralText()) { form.setValueExpression("accept", accept); } else { form.getAttributes() .put("accept", accept.getExpressionString()); } } if (acceptcharset != null) { if (!acceptcharset.isLiteralText()) { form.setValueExpression("acceptcharset", acceptcharset); } else { form.getAttributes().put("acceptcharset", acceptcharset.getExpressionString()); } } if (enctype != null) { if (!enctype.isLiteralText()) { form.setValueExpression("enctype", enctype); } else { form.getAttributes() .put("enctype", enctype.getExpressionString()); } } if (onclick != null) { if (!onclick.isLiteralText()) { form.setValueExpression("onclick", onclick); } else { form.getAttributes() .put("onclick", onclick.getExpressionString()); } } if (onmousedown != null) { if (!onmousedown.isLiteralText()) { form.setValueExpression("onmousedown", onmousedown); } else { form.getAttributes() .put("onmousedown", onmousedown.getExpressionString()); } } if (onmousemove != null) { if (!onmousemove.isLiteralText()) { form.setValueExpression("onmousemove", onmousemove); } else { form.getAttributes() .put("onmousemove", onmousemove.getExpressionString()); } } if (onmouseout != null) { if (!onmouseout.isLiteralText()) { form.setValueExpression("onmouseout", onmouseout); } else { form.getAttributes() .put("onmouseout", onmouseout.getExpressionString()); } } if (onmouseover != null) { if (!onmouseover.isLiteralText()) { form.setValueExpression("onmouseover", onmouseover); } else { form.getAttributes() .put("onmouseover", onmouseover.getExpressionString()); } } if (onmouseup != null) { if (!onmouseup.isLiteralText()) { form.setValueExpression("onmouseup", onmouseup); } else { form.getAttributes() .put("onmouseup", onmouseup.getExpressionString()); } } if (style != null) { if (!style.isLiteralText()) { form.setValueExpression("style", style); } else { form.getAttributes().put("style", style.getExpressionString()); } } } // Methods From TagSupport public int doStartTag() throws JspException { try { return super.doStartTag(); } catch (Exception e) { Throwable root = e; while (root.getCause() != null) { root = root.getCause(); } throw new JspException(root); } } public int doEndTag() throws JspException { try { return super.doEndTag(); } catch (Exception e) { Throwable root = e; while (root.getCause() != null) { root = root.getCause(); } throw new JspException(root); } } // RELEASE public void release() { super.release(); // component properties this.prependId = null; // rendered attributes this.accept = null; this.acceptcharset = null; this.enctype = null; this.onclick = null; this.onmousedown = null; this.onmousemove = null; this.onmouseout = null; this.onmouseover = null; this.onmouseup = null; this.style = null; } public String getDebugString() { String result = "id: " + this.getId() + " class: " + this.getClass().getName(); return result; } }