Interface ListComponentHandler
-
- All Superinterfaces:
ComponentHandler<Object>
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.ListModelWhen dealing with list-like components like combo boxes or list boxes, the
ComponentHandlerreference returned by theComponentBuilderDatainstance for these components can be casted into aListComponentHandler. Then the additional methods are available.- Version:
- $Id: ListComponentHandler.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddItem(int index, Object display, Object value)Adds an item to the component's list model.ListModelgetListModel()Returns theListModelfor this component.voidremoveItem(int index)Removes the list item at the given index.-
Methods inherited from interface net.sf.jguiraffe.gui.forms.ComponentHandler
getComponent, getData, getOuterComponent, getType, isEnabled, setData, setEnabled
-
-
-
-
Method Detail
-
getListModel
ListModel getListModel()
Returns theListModelfor 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 differentListModelimplementation.- Returns:
- the component's list model
-
addItem
void addItem(int index, Object display, Object value)Adds an item to the component's list model. This new item will imediately be displayed in the component's list.- Parameters:
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)
-
removeItem
void removeItem(int index)
Removes the list item at the given index.- Parameters:
index- the index of the item to remove
-
-