com.raj.htmlForms
Class HtmlText

java.lang.Object
  |
  +--com.raj.htmlForms.HtmlFormElement
        |
        +--com.raj.htmlForms.HtmlInput
              |
              +--com.raj.htmlForms.HtmlTextBoxes
                    |
                    +--com.raj.htmlForms.HtmlText

public class HtmlText
extends HtmlTextBoxes

This class will generate an HTML text box.

It will write out something like:

<input type=\"text\" name=\"somename\" value=\"somevalue\">

depending on the attributes set in this class. This class implements all the HTML 4.01 Transitional attributes of a textbox.

This class (HtmlText.java) is part of the com.raj.htmlForms package that automatically generates HTML forms programmatically.

CREATED 22-FEB-2002, Copyright (c) Rajnish Bhaskar 2002

Author:
Rajnish Bhaskar
See Also:
W3C Reference

Field Summary
 
Fields inherited from class com.raj.htmlForms.HtmlFormElement
isXHTML, out
 
Constructor Summary
HtmlText(java.io.Writer w)
          Minimal constructor for any form element.
HtmlText(java.io.Writer w, boolean x, java.lang.String n)
          Constructor that sets the writer, the name of the control and a boolean which determines whether or not XHTML will be written
HtmlText(java.io.Writer w, java.lang.String n)
          Constructor that just sets the name of the element
HtmlText(java.io.Writer w, java.lang.String n, java.lang.String val)
          Constructor that sets the name and value of the element
HtmlText(java.io.Writer w, java.lang.String n, java.lang.String val, int s)
          Constructor that sets the name, value and size of the element
HtmlText(java.io.Writer w, java.lang.String n, java.lang.String val, int s, int ml)
          constructor with the name, value size and maximum length of a control
 
Method Summary
 void write()
          write a textbox with all the fields that have been set also printed
 
Methods inherited from class com.raj.htmlForms.HtmlTextBoxes
getMaxLength, reset, setMaxLength, toString
 
Methods inherited from class com.raj.htmlForms.HtmlInput
getAccessKey, getDisabled, getReadOnly, getSize, getValue, isDisabled, setAccessKey, setReadOnly, setSize, setValue
 
Methods inherited from class com.raj.htmlForms.HtmlFormElement
getDir, getId, getLang, getName, getOnBlur, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyle, getTabIndex, getTheClass, getTitle, getXhtml, setDir, setId, setLang, setName, setOnBlur, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setStyle, setStyle, setTabIndex, setTheClass, setTitle, setXhtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlText

public HtmlText(java.io.Writer w)
Minimal constructor for any form element. All other attributes can be added by the appropriate setter method. This (mostly) follows the standard Java convention for attributes, so the attribute foo becomes setFoo(). The attribute names can be found at the W3C HTML reference or many other places on the web.

Parameters:
w - the Writer to which all the data will be written out
See Also:
W3C Reference for forms

HtmlText

public HtmlText(java.io.Writer w,
                boolean x,
                java.lang.String n)
Constructor that sets the writer, the name of the control and a boolean which determines whether or not XHTML will be written

Parameters:
w - the Writer to which all the data will be written out
x - if true, XHTML1.0 Trans. will be written, else HTML4.01 Trans.
n - the name of this element

HtmlText

public HtmlText(java.io.Writer w,
                java.lang.String n)
Constructor that just sets the name of the element

Parameters:
w - the Writer to which all the data will be written out
n - the name of this element
See Also:
W3C Reference for forms

HtmlText

public HtmlText(java.io.Writer w,
                java.lang.String n,
                java.lang.String val)
Constructor that sets the name and value of the element

Parameters:
w - the Writer to which all the data will be written out
n - the name of this element
val - the initial text in this textbox
See Also:
W3C Reference for forms

HtmlText

public HtmlText(java.io.Writer w,
                java.lang.String n,
                java.lang.String val,
                int s)
Constructor that sets the name, value and size of the element

Parameters:
w - the Writer to which all the data will be written out
n - the name of this element
val - the initial text in this textbox
s - the initial width of the control
See Also:
W3C Reference for forms

HtmlText

public HtmlText(java.io.Writer w,
                java.lang.String n,
                java.lang.String val,
                int s,
                int ml)
constructor with the name, value size and maximum length of a control

Parameters:
w - the Writer to which all the data will be written out
n - the name of this element
val - the initial text in the textbox
s - the initial width of the control
ml - the maximum amount of text that can be entered (in characters)
See Also:
W3C Reference for forms
Method Detail

write

public void write()
write a textbox with all the fields that have been set also printed

Specified by:
write in class HtmlFormElement