/*
 * 
 * Created on Jun 4, 2005
 * 
 * Gy�rgy S�veges
 * Etixpert Kft.
 * Copyright(c) 2005
 * 
 */
package com.etixpert.evolution.gui.servlets.elements;

import javax.servlet.http.HttpSession;

/**
 * @author Suveges Gyorgy
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Input extends FormElement {
    protected int size = 30;
    
    /**
     * @return Returns the size.
     */
    public int getSize() {
        return size;
    }
    /**
     * @param size The size to set.
     */
    public void setSize(int size) {
        this.size = size;
    }
    /**
     * @param session
     * @param jspSite
     * @param key
     */
    public Input(HttpSession session, String jspSite, String key) {
        super(session, jspSite, key);
        // TODO Auto-generated constructor stub
    }
    
    public Input(HttpSession session, String jspSite, String key, String defaultValue, int size) {
        super(session, jspSite, key, defaultValue);
        this.size = size;
    }
    public Input(HttpSession session, String jspSite, String key, int size) {
        super(session, jspSite, key);
        this.size = size;
        // TODO Auto-generated constructor stub
    }

    /* (non-Javadoc)
     * @see com.etixpert.evolution.gui.servlets.elements.FormElement#toHTML()
     */
    public String toHTML() {
        return  "<input type=\"text\" name=\""+key+"\" value=\"" + getValue() + "\" size=\"" +
        		+ size +"\" "+propertiesToHTML() +"/>";
        
    }

}
