/*
* xulfaces : bring XUL power to Java
*
* Copyright (C) 2005 Olivier SCHMITT
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.xulfaces.tag.input;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.xulfaces.annotation.taglib.ATTRIBUTE;
import org.xulfaces.annotation.taglib.TAG;
import org.xulfaces.tag.ModelTag;
/**
*
* @author kito31
* @version $Id: TextboxTag.java,v 1.7 2007/05/08 14:17:56 kito31 Exp $
*/
@TAG(name="textbox",description="Defines a textbox (see XUL textbox element).")
public class TextboxTag extends ModelTag {
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The number of columns in the textarea.")
private String cols;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The maximum number of characters that the textbox allows to be entered.")
private String maxlength;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "If true, the textbox displays multiple lines.")
private String multiline;
@ATTRIBUTE(description = "This event is sent when the value of the textbox is changed. ")
private String onchange;
@ATTRIBUTE(description = "This event is sent when a user enters text in a textbox. ")
private String oninput;
@ATTRIBUTE(description = "Connects the textbox to a corresponding preference.")
private String preference;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "If set to true, then the user cannot modify the value of the textbox. However, the value may still be modified by a script.")
private String readonly;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The number of rows in the textarea.")
private String rows;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The number of characters that can be displayed in the textbox.")
private String size;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The tab order of the element.")
private String tabindex;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "For timed textboxes, the number of milliseconds before the timer fires a command event.")
private String timeout;
@ATTRIBUTE(description = "You can set the type attribute to one of the values below for a more specialized type of textbox.")
private String type;
@ATTRIBUTE(description = "Set this attribute to the value 'off' to disable word wrapping in the textbox.")
private String wrap;
public String getComponentType() {
return "xul.component.Textbox";
}
public String getRendererType() {
return "xul.renderer.Textbox";
}
// @StartGeneration
protected void setProperties(UIComponent component) {
super.setProperties(component);
FacesContext facesContext = getFacesContext();
setIntegerAttribute(facesContext,component,"cols",cols);
setIntegerAttribute(facesContext,component,"maxlength",maxlength);
setBooleanAttribute(facesContext,component,"multiline",multiline);
setStringAttribute(facesContext,component,"onchange",onchange);
setStringAttribute(facesContext,component,"oninput",oninput);
setStringAttribute(facesContext,component,"preference",preference);
setBooleanAttribute(facesContext,component,"readonly",readonly);
setIntegerAttribute(facesContext,component,"rows",rows);
setIntegerAttribute(facesContext,component,"size",size);
setIntegerAttribute(facesContext,component,"tabindex",tabindex);
setIntegerAttribute(facesContext,component,"timeout",timeout);
setStringAttribute(facesContext,component,"type",type);
setStringAttribute(facesContext,component,"wrap",wrap);
}
// @EndGeneration
public String getCols() {
return cols;
}
public void setCols(String cols) {
this.cols = cols;
}
public String getMaxlength() {
return maxlength;
}
public void setMaxlength(String maxlength) {
this.maxlength = maxlength;
}
public String getMultiline() {
return multiline;
}
public void setMultiline(String multiline) {
this.multiline = multiline;
}
public String getOnchange() {
return onchange;
}
public void setOnchange(String onchange) {
this.onchange = onchange;
}
public String getOninput() {
return oninput;
}
public void setOninput(String oninput) {
this.oninput = oninput;
}
public String getPreference() {
return preference;
}
public void setPreference(String preference) {
this.preference = preference;
}
public String getReadonly() {
return readonly;
}
public void setReadonly(String readonly) {
this.readonly = readonly;
}
public String getRows() {
return rows;
}
public void setRows(String rows) {
this.rows = rows;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getTabindex() {
return tabindex;
}
public void setTabindex(String tabindex) {
this.tabindex = tabindex;
}
public String getTimeout() {
return timeout;
}
public void setTimeout(String timeout) {
this.timeout = timeout;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getWrap() {
return wrap;
}
public void setWrap(String wrap) {
this.wrap = wrap;
}
}