2004.04.29


com.jdc.gui.html.form.field
Class TextField

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.gui.html.form.FormField
              |
              +--com.jdc.gui.html.form.field.TextField
Direct Known Subclasses:
PasswordField

public class TextField
extends FormField

TextField is a user interface widget that creates an input text field consisting of a label and an input entry field to be displayed to the user.

Version:
1.0
Author:
Jay Damon
See Also:
Input

Nested Class Summary
 
Nested classes inherited from class com.jdc.gui.html.form.FormField
FormField.Label
 
Field Summary
 
Fields inherited from class com.jdc.gui.html.form.FormField
COLUMN, DISABLED, ENABLED, ERROR, REQUIRED, ROW, WARNING
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
TextField()
          Constructs a TextField object.
 
Method Summary
 TextField addAsterisk()
          Sets a flag to add an asterisk to the text field label.
 TextField addColumn()
          Sets a flag to add column tags to the text field.
 TextField addRow()
          Sets a flag to add row tags to the text field.
 String create()
          Create the text field to be displayed to the user.
 String getAlign()
          Returns the text label and input field alignment.
 String getErrorMessage()
          Returns the text field error message.
 String getField()
          Returns the basic text input field definition.
 String getLabel()
          Returns the basic text field label definition.
 String getName()
          Returns the text field name.
 String getPadding()
          Returns the text field padding.
 int getSize()
          Returns the text field size.
 String getStatus()
          Returns the text field status.
 String getText()
          Returns the text field label.
 String getTip()
          Returns the text field tip.
 String getValue()
          Returns the text field value.
 boolean hasValue()
          Returns true if the text field has a value.
 boolean isAsterisk()
          Returns true if an asterisk is to be added to the text field label.
 boolean isChanged()
          Returns true if the text field value input by the user has changed.
 boolean isError()
          Returns true if the text field value input by the user is in error.
 boolean isRequired()
          Returns true if the text field requires user input.
 boolean isWarning()
          Returns true if the text field value input by the user is acceptable but should be confirmed by the user.
 void reset()
          Reset the text field.
 void resetMessages()
          Reset the text field messages ONLY.
 void setAlign(String align)
          Sets the text label and input field alignment.
 void setError()
          Sets the text field error flag to true.
 void setError(boolean error)
          Sets the text field error flag.
 void setError(String errorMessage)
          Sets the text field error flag and error message.
 void setErrorMessage(String errorMessage)
          Sets the text field error message.
 void setLabel(String label)
          Sets the text field label.
 void setName(String name)
          Sets the text field name.
 void setPadding(int padding)
          Sets the text field padding.
 void setReadOnly()
          Sets the text field read only flag to true.
 void setReadOnly(boolean readOnly)
          Sets the text field read only flag.
 void setRequired()
          Sets the text field required flag to true.
 void setRequired(boolean required)
          Sets the text field required flag.
 void setSize(int size)
          Sets the text field size.
 void setStatus(String status)
          Sets the text field status.
 void setTip(String tip)
          Sets the text field tip.
 void setValue(String value)
          Sets the text field value.
 void setWarning()
          Sets the text field warning flag to true.
 void setWarning(boolean warning)
          Sets the text field warning flag.
 void setWarning(String warningMessage)
          Sets the text field warning flag and warning message.
 String toString()
          Returns a String representation of the TextField object.
 
Methods inherited from class com.jdc.gui.html.form.FormField
add, getType, isAddColumn, isAddRow, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextField

public TextField()
Constructs a TextField object.

Method Detail

addAsterisk

public TextField addAsterisk()
Sets a flag to add an asterisk to the text field label.

Returns:
TextField

addColumn

public TextField addColumn()
Sets a flag to add column tags to the text field.

Returns:
TextField

addRow

public TextField addRow()
Sets a flag to add row tags to the text field. Adding row tags implies adding column tags to the text field as well.

Returns:
TextField

create

public String create()
Create the text field to be displayed to the user.

Returns:
String

getAlign

public String getAlign()
Returns the text label and input field alignment.

Returns:
String

getErrorMessage

public String getErrorMessage()
Returns the text field error message.

Returns:
String

getField

public String getField()
Returns the basic text input field definition.

Returns:
String

getLabel

public String getLabel()
Returns the basic text field label definition.

Returns:
String

getName

public String getName()
Returns the text field name.

Returns:
String

getPadding

public String getPadding()
Returns the text field padding.

Returns:
int

getSize

public int getSize()
Returns the text field size.

Returns:
int

getStatus

public String getStatus()
Returns the text field status.

Returns:
String

getText

public String getText()
Returns the text field label.

Returns:
String

getTip

public String getTip()
Returns the text field tip.

Returns:
String

getValue

public String getValue()
Returns the text field value.

Returns:
String

hasValue

public boolean hasValue()
Returns true if the text field has a value.

Returns:
String

isAsterisk

public boolean isAsterisk()
Returns true if an asterisk is to be added to the text field label.

Returns:
boolean

isChanged

public boolean isChanged()
Returns true if the text field value input by the user has changed.

Specified by:
isChanged in class FormField
Returns:
boolean

isError

public boolean isError()
Returns true if the text field value input by the user is in error.

Specified by:
isError in class FormField
Returns:
boolean

isRequired

public boolean isRequired()
Returns true if the text field requires user input.

Returns:
boolean

isWarning

public boolean isWarning()
Returns true if the text field value input by the user is acceptable but should be confirmed by the user.

Returns:
boolean

reset

public void reset()
Reset the text field.

Specified by:
reset in class FormField

resetMessages

public void resetMessages()
Reset the text field messages ONLY.


setAlign

public void setAlign(String align)
Sets the text label and input field alignment.


setError

public void setError()
Sets the text field error flag to true.


setError

public void setError(boolean error)
Sets the text field error flag.


setError

public void setError(String errorMessage)
Sets the text field error flag and error message.


setErrorMessage

public void setErrorMessage(String errorMessage)
Sets the text field error message.


setLabel

public void setLabel(String label)
Sets the text field label.


setName

public void setName(String name)
Sets the text field name.


setPadding

public void setPadding(int padding)
Sets the text field padding.


setReadOnly

public void setReadOnly()
Sets the text field read only flag to true.


setReadOnly

public void setReadOnly(boolean readOnly)
Sets the text field read only flag.


setRequired

public void setRequired()
Sets the text field required flag to true.


setRequired

public void setRequired(boolean required)
Sets the text field required flag.


setSize

public void setSize(int size)
Sets the text field size.


setStatus

public void setStatus(String status)
Sets the text field status.


setTip

public void setTip(String tip)
Sets the text field tip.


setValue

public void setValue(String value)
Sets the text field value.


setWarning

public void setWarning()
Sets the text field warning flag to true.


setWarning

public void setWarning(boolean warning)
Sets the text field warning flag.


setWarning

public void setWarning(String warningMessage)
Sets the text field warning flag and warning message.


toString

public String toString()
Returns a String representation of the TextField object.

Overrides:
toString in class Object
Returns:
String

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.