Class TableFocusModel<T, TC extends TableColumnBase<T,?>>
java.lang.Object
javafx.scene.control.FocusModel<T>
javafx.scene.control.TableFocusModel<T,TC>
- Type Parameters:
T- The type of the underlying data model for the UI control.TC- The concrete subclass ofTableColumnBasethat is used by the underlying UI control (e.g.TableColumnorTreeTableColumn.
- Direct Known Subclasses:
TableView.TableViewFocusModel, TreeTableView.TreeTableViewFocusModel
The abstract base class for FocusModel implementations that are used within
table-like controls (most notably
TableView and TreeTableView).- Since:
- JavaFX 8.0
-
Property Summary
Properties declared in class FocusModel
focusedIndex, focusedItemTypePropertyDescriptionfinal ReadOnlyIntegerPropertyThe index of the current item in the FocusModel which has the focus.final ReadOnlyObjectProperty<T> The current item in the FocusModel which has the focus. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidCauses the item at the given index to receive the focus.abstract voidAttempts to move focus to the cell above the currently focused cell.abstract voidAttempts to move focus to the cell below the currently focused cell.abstract voidAttempts to move focus to the cell to the left of the currently focused cell.abstract voidAttempts to move focus to the cell to the right of the the currently focused cell.abstract booleanTests whether the row / cell at the given location currently has the focus within the UI control.Methods declared in class FocusModel
focus, focusedIndexProperty, focusedItemProperty, focusNext, focusPrevious, getFocusedIndex, getFocusedItem, getItemCount, getModelItem, isFocusedModifier and TypeMethodDescriptionvoidfocus(int index) Causes the item at the given index to receive the focus.final ReadOnlyIntegerPropertyThe index of the current item in the FocusModel which has the focus.final ReadOnlyObjectProperty<T> The current item in the FocusModel which has the focus.voidAttempts to give focus to the row after to the currently focused row.voidAttempts to give focus to the row previous to the currently focused row.final intGets the value of thefocusedIndexproperty.final TGets the value of thefocusedItemproperty.protected abstract intReturns the number of items in the data model that underpins the control.protected abstract TgetModelItem(int index) Returns the item at the given index.booleanisFocused(int index) Convenience method to inform if the given index is currently focused in this SelectionModel.
-
Constructor Details
-
TableFocusModel
public TableFocusModel()Constructor for subclasses to call.
-
-
Method Details
-
focus
Causes the item at the given index to receive the focus.- Parameters:
row- The row index of the item to give focus to.column- The column of the item to give focus to. Can be null.
-
isFocused
Tests whether the row / cell at the given location currently has the focus within the UI control.- Parameters:
row- the rowcolumn- the column- Returns:
- true if the row / cell at the given location currently has the focus within the UI control
-
focusAboveCell
public abstract void focusAboveCell()Attempts to move focus to the cell above the currently focused cell. -
focusBelowCell
public abstract void focusBelowCell()Attempts to move focus to the cell below the currently focused cell. -
focusLeftCell
public abstract void focusLeftCell()Attempts to move focus to the cell to the left of the currently focused cell. -
focusRightCell
public abstract void focusRightCell()Attempts to move focus to the cell to the right of the the currently focused cell.
-