public interface ListComponentHandler extends ComponentHandler<Object>
A specialized component handler interface for components with list-like structures.
This component handler interface extends the base interface by some methods
that allow access to the component's
and
support its manipulation. This can be useful in cases where an application
needs to update displayed lists at runtime, e.g. in reaction of user input.
ListModel
When dealing with list-like components like combo boxes or list boxes, the
ComponentHandler
reference returned by the
ComponentBuilderData
instance for these components can be casted into a
ListComponentHandler
. Then the additional methods are
available.
Modifier and Type | Method and Description |
---|---|
void |
addItem(int index,
Object display,
Object value)
Adds an item to the component's list model.
|
ListModel |
getListModel()
Returns the
ListModel for this component. |
void |
removeItem(int index)
Removes the list item at the given index.
|
getComponent, getData, getOuterComponent, getType, isEnabled, setData, setEnabled
ListModel getListModel()
ListModel
for this component. From this object
the list's current content can be obtained. Note that the object returned
here need not be identical to or even of the same class than the original
specified list model for the component. A component manager
implementation can provide a different ListModel
implementation.void addItem(int index, Object display, Object value)
index
- the index where the item is to be inserted (0 based)display
- the display object (to be displayed in the list)value
- the corresponding value object (to be stored in the form's
data; can be null)void removeItem(int index)
index
- the index of the item to removeCopyright © 2016 The JGUIraffe Team. All rights reserved.