org.w3c.tools.forms
Class StringField

java.lang.Object
  |
  +--org.w3c.tools.forms.FormField
        |
        +--org.w3c.tools.forms.StringField
Direct Known Subclasses:
FileField

public class StringField
extends FormField

An editor for string fields.


Fields inherited from class org.w3c.tools.forms.FormField
manager, name, title
 
Constructor Summary
StringField(FormManager manager, java.lang.String name, java.lang.String title)
          Create a new field for string edition, with no initial value.
StringField(FormManager manager, java.lang.String name, java.lang.String title, java.lang.String value)
          Create a new field for string edition.
 
Method Summary
 boolean acceptChange(java.lang.String value)
          Do we want to accept this value as our new value.
 java.awt.Component getEditor()
          FormField implementation - Get the editor for the field.
 java.lang.String getStringValue()
          Get this field value as a String.
 java.lang.Object getValue()
          Get this field's value according to its native type.
 void setValue(java.lang.Object value, boolean notify, boolean update)
          Set this field value.
 void setValue(java.lang.String value, boolean notify, boolean update)
          Set this field value.
 
Methods inherited from class org.w3c.tools.forms.FormField
getName, getTitle, gotFocus, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringField

public StringField(FormManager manager,
                   java.lang.String name,
                   java.lang.String title,
                   java.lang.String value)
Create a new field for string edition.
Parameters:
manager - The form manager.
value - The initial value for the field.

StringField

public StringField(FormManager manager,
                   java.lang.String name,
                   java.lang.String title)
Create a new field for string edition, with no initial value.
Parameters:
manager - The form manager.
name - The field's name.
title - The field's title.
Method Detail

acceptChange

public boolean acceptChange(java.lang.String value)
Do we want to accept this value as our new value.

getValue

public java.lang.Object getValue()
Get this field's value according to its native type.
Overrides:
getValue in class FormField

getStringValue

public java.lang.String getStringValue()
Get this field value as a String.

setValue

public void setValue(java.lang.Object value,
                     boolean notify,
                     boolean update)
              throws IllegalFieldValueException
Set this field value.
Overrides:
setValue in class FormField
Throws:
IllegalFieldValueException - if the value isn't accepted

setValue

public void setValue(java.lang.String value,
                     boolean notify,
                     boolean update)
              throws IllegalFieldValueException
Set this field value.
Throws:
IllegalFieldValueException - if the value isn't accepted

getEditor

public java.awt.Component getEditor()
FormField implementation - Get the editor for the field.