Class ListCell<T>

Type Parameters:
T - The type of the item contained within the ListCell.
All Implemented Interfaces:
Styleable, EventTarget, Skinnable
Direct Known Subclasses:
CheckBoxListCell, ChoiceBoxListCell, ComboBoxListCell, TextFieldListCell

public class ListCell<T> extends IndexedCell<T>

The Cell type used within ListView instances. In addition to the API defined on Cell and IndexedCell, the ListCell is more tightly bound to a ListView, allowing for better support of editing events, etc.

A ListView maintains selection, indicating which cell(s) have been selected, and focus, indicating the current focus owner for any given ListView. For each property, each ListCell has a boolean reflecting whether this specific cell is selected or focused. To achieve this, each ListCell has a reference back to the ListView that it is being used within. Each ListCell belongs to one and only one ListView.

Note that in the case of virtualized controls like ListView, when a cell has focus this is not in the same sense as application focus. When a ListCell has focus it simply represents the fact that the cell will receive keyboard events in the situation that the owning ListView actually contains focus. Of course, in the case where a cell has a Node set in the graphic property, it is completely legal for this Node to request, and acquire focus as would normally be expected.

Since:
JavaFX 2.0
  • Property Details

  • Constructor Details

    • ListCell

      public ListCell()
      Creates a default ListCell with the default style class of 'list-cell'.
  • Method Details

    • getListView

      public final ListView<T> getListView()
      Gets the value of the property listView.
      Property description:
      The ListView associated with this Cell.
    • listViewProperty

      public final ReadOnlyObjectProperty<ListView<T>> listViewProperty()
      The ListView associated with this Cell.
      See Also:
    • updateListView

      public final void updateListView(ListView<T> listView)
      Updates the ListView associated with this Cell. Note: This function is intended to be used by experts, primarily by those implementing new Skins. It is not common for developers or designers to access this function directly.
      Parameters:
      listView - the ListView associated with this cell