Class ListOption

All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class ListOption extends AbstractOption
Option holding a JList as its UI component. The list selection mode can be either simple selection or multiple interval selection.
Author:
Laurent Cohen
See Also:
  • Field Details

    • list

      protected JList<Object> list
      The underlying JList component.
    • items

      protected List<Object> items
      The items contained in the list.
    • selMode

      protected int selMode
      The selection mode for the list.
    • selectionListener

      protected transient ListSelectionListener selectionListener
      Selection listener set on the list and used to propagate selection changes as value change events.
  • Constructor Details

    • ListOption

      public ListOption()
      Default constructor.
    • ListOption

      public ListOption(String name, String label, String tooltip, List<Object> value, List<Object> items, int selMode)
      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.
      selMode - the mode of selection for the list, can be either SINGLE_SELECTION or MULTIPLE_INTERVAL_SELECTION.
  • Method Details

    • setupValueChangeNotifications

      protected void setupValueChangeNotifications()
      Define a selection listener that will forward selection changes to all value change listeners that registered with this option.
      Specified by:
      setupValueChangeNotifications in class AbstractOption
    • createUI

      public void createUI()
      Create the UI components for this option.
      Specified by:
      createUI in class AbstractOptionProperties
    • setEnabled

      public void setEnabled(boolean enabled)
      Enable or disable this option.
      Parameters:
      enabled - true to enable this option, false to disable it.
    • setValue

      public void setValue(Object value)
      Set the value of this option.
      Overrides:
      setValue in class AbstractOption
      Parameters:
      value - the value as an Object instance.
    • getItems

      public List<Object> getItems()
      Get the items in the list.
      Returns:
      a list of Object instances.
    • setItems

      public void setItems(List<Object> items)
      Set the items in the list.
      Parameters:
      items - a list of Object instances.
    • getSelMode

      public int getSelMode()
      Get the selection mode for the list.
      Returns:
      the selection mode as an int value.
    • setSelMode

      public void setSelMode(int selMode)
      Set the selection mode for the list.
      Parameters:
      selMode - the selection mode as an int value.
    • getList

      public JList<Object> getList()
      Get the list component.
      Returns:
      a JList instance.