org.jppf.ui.options
Class ComboBoxOption

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.ComboBoxOption
All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class ComboBoxOption
extends AbstractOption

Option that uses a combo box to select its value.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
protected  JLabel comboLabel
          Label associated with the combo box.
protected  List items
          The items in the drop dwon list.
 
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
ComboBoxOption()
          Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
ComboBoxOption(String name, String label, String tooltip, Object value, List<Object> items)
          Initialize this combo box option with the specified parameters.
 
Method Summary
 void createUI()
          Create the UI components for this option.
 JComboBox getComboBox()
          Get the combo box used to select one among several items.
 List getItems()
          Get the list of items in the combo box.
 Object getValue()
          Get the current value for this option.
 void setEnabled(boolean enabled)
          Enable or disable this option.
 void setItems(List items)
          Set the list of items in the combo box.
protected  void setupValueChangeNotifications()
          Propagate the selection changes in the underlying combo box to the listeners to this option.
 void setValue(Object value)
          Set the current value for this option.
 
Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent
 
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

comboLabel

protected JLabel comboLabel
Label associated with the combo box.


items

protected List items
The items in the drop dwon list.

Constructor Detail

ComboBoxOption

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


ComboBoxOption

public ComboBoxOption(String name,
                      String label,
                      String tooltip,
                      Object value,
                      List<Object> items)
Initialize this combo box option with the specified parameters.

Parameters:
name - this component's name.
label - the label displayed with the checkbox.
tooltip - the tooltip associated with the combobox.
value - the initially selected value of this component.
items - the initial list of items in the combo box.
Method Detail

createUI

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

Specified by:
createUI in class AbstractOptionProperties

getValue

public Object getValue()
Get the current value for this option.

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

setValue

public void setValue(Object value)
Set the current value for this option.

Overrides:
setValue in class AbstractOption
Parameters:
value - a Boolean instance.
See Also:
AbstractOption.setValue(java.lang.Object)

setupValueChangeNotifications

protected void setupValueChangeNotifications()
Propagate the selection changes in the underlying combo box to the listeners to this option.

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)

getItems

public List getItems()
Get the list of items in the combo box.

Returns:
a list of Object instances.

setItems

public void setItems(List items)
Set the list of items in the combo box.

Parameters:
items - a list of Object instances.

getComboBox

public JComboBox getComboBox()
Get the combo box used to select one among several items.

Returns:
a JComboBox instance.


Copyright © 2005-2010 JPPF Team.