org.w3c.tools.forms
Class OptionField
java.lang.Object
|
+--org.w3c.tools.forms.FormField
|
+--org.w3c.tools.forms.OptionField
- Direct Known Subclasses:
- BooleanField
- public class OptionField
- extends FormField
Constructor Summary |
OptionField(FormManager manager,
java.lang.String name,
java.lang.String title,
java.lang.String[] options,
int value)
Create an option field. |
Method Summary |
boolean |
acceptChange(int idx)
Do we accept to change to the given (valid) index ? |
java.awt.Component |
getEditor()
Get an editor to edit this option's value. |
int |
getIntValue()
Get the selected option as its index in our array of options. |
java.lang.String |
getStringValue()
Get the selected option as a String. |
java.lang.Object |
getValue()
Get this field's value in its native type. |
void |
setValue(int idx,
boolean notify,
boolean update)
Set this option's value. |
void |
setValue(java.lang.Object value,
boolean notify,
boolean update)
Set this option's value. |
void |
setValue(java.lang.String value,
boolean notify,
boolean update)
Set this option's value. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
OptionField
public OptionField(FormManager manager,
java.lang.String name,
java.lang.String title,
java.lang.String[] options,
int value)
throws IllegalFieldValueException
- Create an option field.
- Throws:
- IllegalFieldValueException - if the value isn't accepted
acceptChange
public boolean acceptChange(int idx)
- Do we accept to change to the given (valid) index ?
getValue
public java.lang.Object getValue()
- Get this field's value in its native type.
- Returns:
- The currently selected option as a String.
- Overrides:
- getValue in class FormField
getIntValue
public int getIntValue()
- Get the selected option as its index in our array of options.
getStringValue
public java.lang.String getStringValue()
- Get the selected option as a String.
setValue
public void setValue(java.lang.Object value,
boolean notify,
boolean update)
throws IllegalFieldValueException
- Set this option's value.
- Parameters:
value
- The new value.update
- Should we update the editor view.- Throws:
- IllegalFieldValueException - if the value isn't accepted
- Overrides:
- setValue in class FormField
setValue
public void setValue(int idx,
boolean notify,
boolean update)
throws IllegalFieldValueException
- Set this option's value.
- Parameters:
idx
- The index of the option to set.update
- Should we update our editor's view.- Throws:
- IllegalFieldValueException - if the value isn't accepted
setValue
public void setValue(java.lang.String value,
boolean notify,
boolean update)
throws IllegalFieldValueException
- Set this option's value.
- Throws:
- IllegalFieldValueException - if the value isn't accepted
getEditor
public java.awt.Component getEditor()
- Get an editor to edit this option's value.