public abstract class FocusModel<T> extends Object
Constructor and Description |
---|
FocusModel()
Creates a default FocusModel instance.
|
Modifier and Type | Method and Description |
---|---|
void |
focus(int index)
Causes the item at the given index to receive the focus.
|
ReadOnlyIntegerProperty |
focusedIndexProperty() |
ReadOnlyObjectProperty<T> |
focusedItemProperty() |
void |
focusNext()
Attempts to give focus to the row after to the currently focused row.
|
void |
focusPrevious()
Attempts to give focus to the row previous to the currently focused row.
|
int |
getFocusedIndex() |
T |
getFocusedItem() |
protected abstract int |
getItemCount()
Returns the number of items in the data model that underpins the control.
|
protected abstract T |
getModelItem(int index)
Returns the item at the given index.
|
boolean |
isFocused(int index)
Convenience method to inform if the given index is currently focused
in this SelectionModel.
|
public final ReadOnlyIntegerProperty focusedIndexProperty()
public final int getFocusedIndex()
public final ReadOnlyObjectProperty<T> focusedItemProperty()
public final T getFocusedItem()
protected abstract int getItemCount()
listView.getItems().size()
. The valid range of focusable
indices is between 0 and whatever is returned by this method.protected abstract T getModelItem(int index)
listView.getItems().get(index)
.index
- The index of the item that is requested from the underlying
data model.public boolean isFocused(int index)
Convenience method to inform if the given index is currently focused in this SelectionModel. Is functionally equivalent to calling
getFocusedIndex() == index
.index
- The index to check as to whether it is currently focused
or not.public void focus(int index)
focusedIndex = -1
unless
0 <= index < model size
.index
- The index of the item to get focus.public void focusPrevious()
public void focusNext()
Copyright © 2020. All rights reserved.