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.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private final InvalidationListener | editingListener
Listens to the editing index on the ListView. |
| private boolean | |
| private final InvalidationListener | focusedListener
Listens to the focus model on the ListView. |
| private final ChangeListener | focusModelPropertyListener
Listens to the focusModel property on the ListView. |
| private int | |
| private final ListChangeListener | itemsListener
Listens to the items on the ListView. |
| private final InvalidationListener | itemsPropertyListener
Listens to the items property on the ListView. |
| private ReadOnlyObjectWrapper | listView
The ListView associated with this Cell. |
| private final ListChangeListener | selectedListener
Listens to the selection model on the ListView. |
| private final ChangeListener | selectionModelPropertyListener
Listens to the selectionModel property on the ListView. |
| private boolean | |
| private final WeakInvalidationListener | |
| private final WeakInvalidationListener | |
| private final WeakChangeListener | |
| private final WeakListChangeListener | |
| private final WeakInvalidationListener | |
| private final WeakListChangeListener | |
| private final WeakChangeListener |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancelEdit()
Overrides javafx. Cancels an edit to the value of the cell. |
| public void | commitEdit(T
the value as input by the end user, which should be
persisted in the relevant way given the data source underpinning the
user interface and the install edit commit handler of the UI control newValue)Overrides javafx. Commits an edit to the value of the cell. |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public void | executeAccessibleAction(AccessibleAction
the action to execute action, Object... optional list of parameters parameters)Overrides javafx. This method is called by the assistive technology to request the action indicated by the argument should be executed. |
| public final ListView | |
| pack-priv void | indexChanged(int
the old index oldIndex, int the new index newIndex)Overrides javafx. This method is called whenever the index is changed, regardless of whether the new index is the same as the old index. |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| public final ReadOnlyObjectProperty | |
| public Object | queryAccessibleAttribute(AccessibleAttribute
the requested attribute attribute, Object... optional list of parameters parameters)Overrides javafx. This method is called by the assistive technology to request the value for an attribute. |
| private void | |
| public void | |
| private void | |
| private void | |
| private void | |
| public final void | updateListView(ListView<T>
the ListView associated with this cell listView)Updates the ListView associated with this Cell. |
| private void |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_STYLE_CLASS | |
| editingListener | back to summary |
|---|---|
| private final InvalidationListener editingListener Listens to the editing index on the ListView. It is possible for the developer to call the ListView#edit(int) method and cause a specific cell to start editing. In such a case, we need to be notified so we can call startEdit on our side. | |
| firstRun | back to summary |
|---|---|
| private boolean firstRun | |
| focusedListener | back to summary |
|---|---|
| private final InvalidationListener focusedListener Listens to the focus model on the ListView. Whenever the focus model changes, the focused property on the ListCell is updated | |
| focusModelPropertyListener | back to summary |
|---|---|
| private final ChangeListener<FocusModel<T>> focusModelPropertyListener Listens to the focusModel property on the ListView. Whenever the entire model is changed, we have to unhook the weakFocusedListener and update the focus. | |
| indexAtStartEdit | back to summary |
|---|---|
| private int indexAtStartEdit | |
| itemsListener | back to summary |
|---|---|
| private final ListChangeListener<T> itemsListener Listens to the items on the ListView. Whenever the items are changed in such a way that it impacts the index of this ListCell, then we must update the item. | |
| itemsPropertyListener | back to summary |
|---|---|
| private final InvalidationListener itemsPropertyListener Listens to the items property on the ListView. Whenever the entire list is changed, we have to unhook the weakItemsListener and update the item. | |
| listView | back to summary |
|---|---|
| private ReadOnlyObjectWrapper<ListView<T>> listView The ListView associated with this Cell. | |
| selectedListener | back to summary |
|---|---|
| private final ListChangeListener<Integer> selectedListener Listens to the selection model on the ListView. Whenever the selection model is changed (updated), the selected property on the ListCell is updated accordingly. | |
| selectionModelPropertyListener | back to summary |
|---|---|
| private final ChangeListener<MultipleSelectionModel<T>> selectionModelPropertyListener Listens to the selectionModel property on the ListView. Whenever the entire model is changed, we have to unhook the weakSelectedListener and update the selection. | |
| updateEditingIndex | back to summary |
|---|---|
| private boolean updateEditingIndex | |
| weakEditingListener | back to summary |
|---|---|
| private final WeakInvalidationListener weakEditingListener | |
| weakFocusedListener | back to summary |
|---|---|
| private final WeakInvalidationListener weakFocusedListener | |
| weakFocusModelPropertyListener | back to summary |
|---|---|
| private final WeakChangeListener<FocusModel<T>> weakFocusModelPropertyListener | |
| weakItemsListener | back to summary |
|---|---|
| private final WeakListChangeListener<T> weakItemsListener | |
| weakItemsPropertyListener | back to summary |
|---|---|
| private final WeakInvalidationListener weakItemsPropertyListener | |
| weakSelectedListener | back to summary |
|---|---|
| private final WeakListChangeListener<Integer> weakSelectedListener | |
| weakSelectionModelPropertyListener | back to summary |
|---|---|
| private final WeakChangeListener<MultipleSelectionModel<T>> weakSelectionModelPropertyListener | |
| ListCell | back to summary |
|---|---|
| public ListCell() Creates a default ListCell with the default style class of 'list-cell'. | |
| cancelEdit | back to summary |
|---|---|
| public void cancelEdit() Overrides javafx. Doc from javafx. Cancels an edit to the value of the cell. Call this function to transition from an editing state into a non-editing state, without saving any user input.
| |
| commitEdit | back to summary |
|---|---|
| public void commitEdit(T newValue) Overrides javafx. Doc from javafx. Commits an edit to the value of the cell. Call this function when appropriate (based on the user interaction requirements of your cell editing user interface) to do two things:
In general there is no need to override this method in custom cell
implementations - it should be sufficient to simply call this method
when appropriate (e.g., when the user pressed the Enter key, you may do something
like
| |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS | |
| executeAccessibleAction | back to summary |
|---|---|
| public void executeAccessibleAction(AccessibleAction action, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the action indicated by the argument should be executed.
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
| |
| getListView | back to summary |
|---|---|
| public final ListView | |
| indexChanged | back to summary |
|---|---|
| pack-priv void indexChanged(int oldIndex, int newIndex) Overrides javafx. Doc from javafx. This method is called whenever the index is changed, regardless of whether the new index is the same as the old index.
| |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren() Overrides javafx. Doc from javafx. Invoked during the layout pass to layout the children in this
Subclasses should override this function to layout content as needed.
| |
| listViewProperty | back to summary |
|---|---|
| public final ReadOnlyObjectProperty | |
| queryAccessibleAttribute | back to summary |
|---|---|
| public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the value for an attribute.
This method is commonly overridden by subclasses to implement
attributes that are required for a specific role.
| |
| setListView | back to summary |
|---|---|
| private void setListView(ListView<T> value) | |
| startEdit | back to summary |
|---|---|
| public void startEdit() Overrides javafx. Doc from javafx. Starts an edit to the value of the cell. Call this function to transition from a non-editing state into an editing state, if the cell is editable. If this cell is already in an editing state, it will stay in it.
| |
| updateEditing | back to summary |
|---|---|
| private void updateEditing() | |
| updateFocus | back to summary |
|---|---|
| private void updateFocus() | |
| updateItem | back to summary |
|---|---|
| private void updateItem(int oldIndex) | |
| updateListView | back to summary |
|---|---|
| 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.
| |
| updateSelection | back to summary |
|---|---|
| private void updateSelection() | |