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
Enclosing class:
ListArea<E>

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 Summary

    Modifier and Type
    Method
    Description
    getItem(int index)
    Returns the item at the given index.
    int
    Returns the total number of items in the model.
    void
    Called when the underlying data has changed and the list needs to be refreshed.
  • Method Details

    • getItemCount

      int getItemCount()
      Returns the total number of items in the model.
      Returns:
      the item count
    • getItem

      E getItem(int index)
      Returns the item at the given index.
      Parameters:
      index - the zero-based index of the item
      Returns:
      the item at that position, or null if 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.