java.lang.Object
javafx.scene.control.FocusModel<T>
javafx.scene.control.TableFocusModel<S,TableColumn<S,?>>
javafx.scene.control.TableView.TableViewFocusModel<S>
public static class TableView.TableViewFocusModel<S> extends TableFocusModel<S,TableColumn<S,?>>
A
FocusModel with additional functionality to support the requirements
of a TableView control.- Since:
- JavaFX 2.0
- See Also:
TableView
-
Property Summary
Properties Type Property Description ReadOnlyObjectProperty<TablePosition>focusedCellThe position of the current item in the TableView which has the focus.Properties declared in class javafx.scene.control.FocusModel
focusedIndex, focusedItem -
Constructor Summary
Constructors Constructor Description TableViewFocusModel(TableView<S> tableView)Creates a default TableViewFocusModel instance that will be used to manage focus of the provided TableView control. -
Method Summary
Modifier and Type Method Description voidfocus(int index)Causes the item at the given index to receive the focus.voidfocus(int row, TableColumn<S,?> column)Causes the item at the given index to receive the focus.voidfocus(TablePosition pos)Convenience method for setting focus on a particular row or cell using aTablePosition.voidfocusAboveCell()Attempts to move focus to the cell above the currently focused cell.voidfocusBelowCell()Attempts to move focus to the cell below the currently focused cell.ReadOnlyObjectProperty<TablePosition>focusedCellProperty()The position of the current item in the TableView which has the focus.voidfocusLeftCell()Attempts to move focus to the cell to the left of the currently focused cell.voidfocusRightCell()Attempts to move focus to the cell to the right of the the currently focused cell.TablePositiongetFocusedCell()Gets the value of the property focusedCell.booleanisFocused(int row, TableColumn<S,?> column)Tests whether the row / cell at the given location currently has the focus within the TableView.Methods declared in class javafx.scene.control.FocusModel
focusedIndexProperty, focusedItemProperty, focusNext, focusPrevious, getFocusedIndex, getFocusedItem, getItemCount, getModelItem, isFocused
-
Property Details
-
focusedCell
The position of the current item in the TableView which has the focus.- See Also:
getFocusedCell()
-
-
Constructor Details
-
TableViewFocusModel
Creates a default TableViewFocusModel instance that will be used to manage focus of the provided TableView control.- Parameters:
tableView- The tableView upon which this focus model operates.- Throws:
NullPointerException- The TableView argument can not be null.
-
-
Method Details
-
focusedCellProperty
The position of the current item in the TableView which has the focus.- See Also:
getFocusedCell()
-
getFocusedCell
Gets the value of the property focusedCell.- Property description:
- The position of the current item in the TableView which has the focus.
-
focus
Causes the item at the given index to receive the focus.- Specified by:
focusin classTableFocusModel<S,TableColumn<S,?>>- 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.
-
focus
Convenience method for setting focus on a particular row or cell using aTablePosition.- Parameters:
pos- The table position where focus should be set.
-
isFocused
Tests whether the row / cell at the given location currently has the focus within the TableView.- Specified by:
isFocusedin classTableFocusModel<S,TableColumn<S,?>>- Parameters:
row- the rowcolumn- the column- Returns:
- true if the row / cell at the given location currently has the focus within the UI control
-
focus
public void focus(int index)Causes the item at the given index to receive the focus. This does not cause the current selection to change. Updates the focusedItem and focusedIndex properties such thatfocusedIndex = -1unless
.0 <= index < model size- Overrides:
focusin classFocusModel<S>- Parameters:
index- The index of the item to get focus.
-
focusAboveCell
public void focusAboveCell()Attempts to move focus to the cell above the currently focused cell.- Specified by:
focusAboveCellin classTableFocusModel<S,TableColumn<S,?>>
-
focusBelowCell
public void focusBelowCell()Attempts to move focus to the cell below the currently focused cell.- Specified by:
focusBelowCellin classTableFocusModel<S,TableColumn<S,?>>
-
focusLeftCell
public void focusLeftCell()Attempts to move focus to the cell to the left of the currently focused cell.- Specified by:
focusLeftCellin classTableFocusModel<S,TableColumn<S,?>>
-
focusRightCell
public void focusRightCell()Attempts to move focus to the cell to the right of the the currently focused cell.- Specified by:
focusRightCellin classTableFocusModel<S,TableColumn<S,?>>
-