sdsu.html
Class TextInput

java.lang.Object
  |
  +--sdsu.html.TextInput

public class TextInput
extends java.lang.Object
implements HTML

There are three types of Text inputs: scrolling (TEXTAREA tag), single-line (INPUT tag) and password (INPUT tag). Examples of each:

Scrolling
Single-line
Password


All must be used in a form. Text in input area is reported as: TextInputName=TextInInputArea. Where TextInputName is the name given to the TextInput object, and TextInInputArea is the text in the input area when the form is sent.

Use static methods TextInput.scrolling( ), TextInput.singleLine(...), TextInput.password(...) to create instance of this class.

Version:
0.8 6 April 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Method Summary
static TextInput password(java.lang.String name, int numberOfColumns)
          Create a text input area for entering passwords.
static TextInput scrolling(java.lang.String name, int numberOfRows, int numberOfColumns)
          Create a scrolling text input area.
 void setInitalText(java.lang.String text)
          Sets the inital text seen in the text input.
static TextInput singleLine(java.lang.String name, int numberOfColumns)
          Create a single-line text input area.
static TextInput singleLine(java.lang.String name, int numberOfColumns, int maxTextLength)
          Create a single-line text input area.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

scrolling

public static TextInput scrolling(java.lang.String name,
                                  int numberOfRows,
                                  int numberOfColumns)
Create a scrolling text input area.
Parameters:
name - name used to report the contents of text area to a cgi program. The value reported will be the text in the text input.
numberOfRows - number of rows of text displayable in the text area, should be at least three, so the scrollbars look reasonable.
numberOfColumns - the width of the text input in number of characters.

singleLine

public static TextInput singleLine(java.lang.String name,
                                   int numberOfColumns)
Create a single-line text input area.
Parameters:
name - name used to report the contents of text area to a cgi program. The value reported will be the text in the text input.
numberOfColumns - the width of the text input in number of characters.

singleLine

public static TextInput singleLine(java.lang.String name,
                                   int numberOfColumns,
                                   int maxTextLength)
Create a single-line text input area.
Parameters:
name - name used to report the contents of text area to a cgi program. The value reported will be the text in the text input.
numberOfColumns - the width of the text input in number of characters.
maxTextLength - maximum number of characters a user is allowed to enter.

password

public static TextInput password(java.lang.String name,
                                 int numberOfColumns)
Create a text input area for entering passwords. Input is echoed as * or some other single character.
Parameters:
name - name used to report the contents of text area to a cgi program. The value reported will be the text in the text input.
numberOfColumns - the width of the text input in number of characters.

setInitalText

public void setInitalText(java.lang.String text)
Sets the inital text seen in the text input. Must be plain text. No html marked text allowed. Special characters in text are escaped for you.

toString

public java.lang.String toString()
Specified by:
toString in interface HTML
Overrides:
toString in class java.lang.Object