org.jppf.ui.options
Class TextOption

java.lang.Object
  extended by org.jppf.ui.options.AbstractOptionProperties
      extended by org.jppf.ui.options.AbstractOptionElement
          extended by org.jppf.ui.options.AbstractOption
              extended by org.jppf.ui.options.TextOption
All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties
Direct Known Subclasses:
PasswordOption, PlainTextOption

public abstract class TextOption
extends AbstractOption

Text option displayed as a text field.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
protected  JTextField field
          Text field containing the option value as text.
protected  JLabel fieldLabel
          Label associated with the text field.
 
Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, value
 
Fields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, root
 
Fields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, eventsEnabled, finalizer, iconPath, initializer, label, layoutConstraints, name, scripts, scrollable, toolTipText, UIComponent
 
Constructor Summary
TextOption()
          Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
TextOption(String name, String label, String tooltip, String value)
          Initialize this text option with the specified parameters.
 
Method Summary
protected abstract  JTextField createField()
          Create the text field that holds the value of this option.
 void createUI()
          Create the UI components for this option.
 Object getValue()
          Get the text in the text field.
 void setEnabled(boolean enabled)
          Enable or disable this option.
protected  void setupValueChangeNotifications()
          Add a listener to the underlying text document, to receive and propagate change events.
 
Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, setValue
 
Methods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParent, toString
 
Methods inherited from class org.jppf.ui.options.AbstractOptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setBordered, setComponentConstraints, setEditable, setEventsEnabled, setFinalizer, setIconPath, setInitializer, setLabel, setLayoutConstraints, setName, setScrollable, setToolTipText, setUIComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPath
 
Methods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEventsEnabled, setLayoutConstraints
 

Field Detail

field

protected JTextField field
Text field containing the option value as text.


fieldLabel

protected JLabel fieldLabel
Label associated with the text field.

Constructor Detail

TextOption

public TextOption()
Constructor provided as a convenience to facilitate the creation of option elements through reflexion.


TextOption

public TextOption(String name,
                  String label,
                  String tooltip,
                  String value)
Initialize this text option with the specified parameters.

Parameters:
name - this component's name.
label - the label displayed with the checkbox.
tooltip - the tooltip associated with the checkbox.
value - the initial value of this component.
Method Detail

createUI

public void createUI()
Create the UI components for this option.

Specified by:
createUI in class AbstractOptionProperties

createField

protected abstract JTextField createField()
Create the text field that holds the value of this option.

Returns:
a JTextField instance.

getValue

public Object getValue()
Get the text in the text field.

Specified by:
getValue in interface Option
Overrides:
getValue in class AbstractOption
Returns:
a string value.
See Also:
AbstractOption.getValue()

setupValueChangeNotifications

protected void setupValueChangeNotifications()
Add a listener to the underlying text document, to receive and propagate change events.

Specified by:
setupValueChangeNotifications in class AbstractOption
See Also:
AbstractOption.setupValueChangeNotifications()

setEnabled

public void setEnabled(boolean enabled)
Enable or disable this option.

Parameters:
enabled - true to enable this option, false to disable it.
See Also:
OptionProperties.setEnabled(boolean)


Copyright © 2005-2010 JPPF Team.