: Class OptionField

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Fields inherited from class org.w3c.tools.forms.FormField
`manager, name, title`

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 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

### 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

Method Detail

### 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.
  Overrides:
    getValue in class FormField
  Returns:
    The currently selected option as a String.

### 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.
  Overrides:
    setValue in class FormField
  Parameters:
    `value` - The new value.
    `update` - Should we update the editor view.
  Throws:
    IllegalFieldValueException - if the value isn't accepted

### 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD