Package org.luwrain.controls
Interface ListArea.Model<E>
- Type Parameters:
E- the type of items in the list
- All Known Subinterfaces:
EditableListArea.Model<E>
- All Known Implementing Classes:
ChooseMailPopup.Model,CommanderArea.ListModelAdapter,ListModel,ListUtils.ArrayModel,ListUtils.DefaultEditableModel,ListUtils.FixedModel,ListUtils.ListModel,TreeListArea.ModelImpl
public static interface ListArea.Model<E>
Provides the data for the list. The model is responsible for the number
of items, retrieving an item by index, and notifying the list when the
underlying data has changed.
-
Method Details
-
getItemCount
int getItemCount()Returns the total number of items in the model.- Returns:
- the item count
-
getItem
Returns the item at the given index.- Parameters:
index- the zero-based index of the item- Returns:
- the item at that position, or
nullif the index is out of bounds
-
refresh
void refresh()Called when the underlying data has changed and the list needs to be refreshed. Implementations should reload or update their data.
-