Package org.jppf.ui.options
Class ListOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
org.jppf.ui.options.ListOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
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 Summary
FieldsModifier and TypeFieldDescriptionThe items contained in the list.The underlying JList component.protected ListSelectionListenerSelection listener set on the list and used to propagate selection changes as value change events.protected intThe selection mode for the list.Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, valueFields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, rootFields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, detachable, eventsEnabled, finalizer, horizontalScrollbar, iconPath, initializer, label, layoutConstraints, mouseListener, name, scripts, scrollable, toolTipText, UIComponent, verticalScrollbar -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUI()Create the UI components for this option.getItems()Get the items in the list.getList()Get the list component.intGet the selection mode for the list.voidsetEnabled(boolean enabled) Enable or disable this option.voidSet the items in the list.voidsetSelMode(int selMode) Set the selection mode for the list.protected voidDefine a selection listener that will forward selection changes to all value change listeners that registered with this option.voidSet the value of this option.Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, getValue, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, toStringMethods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParentMethods inherited from class org.jppf.ui.options.AbstractOptionProperties
createScrollPane, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEditable, setEventsEnabled, setFinalizer, setHorizontalScrollbar, setIconPath, setInitializer, setLabel, setLayoutConstraints, setMouseListener, setName, setScrollable, setToolTipText, setUIComponent, setVerticalScrollbarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPathMethods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Field Details
-
list
The underlying JList component. -
items
The items contained in the list. -
selMode
protected int selModeThe selection mode for the list. -
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 eitherSINGLE_SELECTIONorMULTIPLE_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:
setupValueChangeNotificationsin classAbstractOption
-
createUI
public void createUI()Create the UI components for this option.- Specified by:
createUIin classAbstractOptionProperties
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this option.- Parameters:
enabled- true to enable this option, false to disable it.
-
setValue
Set the value of this option.- Overrides:
setValuein classAbstractOption- Parameters:
value- the value as anObjectinstance.
-
getItems
Get the items in the list.- Returns:
- a list of
Objectinstances.
-
setItems
Set the items in the list.- Parameters:
items- a list ofObjectinstances.
-
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
Get the list component.- Returns:
- a
JListinstance.
-