public static class TreeTableView.TreeTableViewFocusModel<S> extends TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
FocusModel
with additional functionality to support the requirements
of a TableView control.TableView
Type | Property and Description |
---|---|
<any> |
focusedCell
The position of the current item in the TableView which has the focus.
|
focusedIndexProperty, focusedItemProperty
Modifier and Type | Field and Description |
---|---|
private TreeTablePosition |
EMPTY_CELL |
private <any> |
focusedCell
The position of the current item in the TableView which has the focus.
|
private <any> |
rootPropertyListener |
private <any> |
treeItemListener |
private TreeTableView<S> |
treeTableView |
private <any> |
weakRootPropertyListener |
private <any> |
weakTreeItemListener |
Constructor and Description |
---|
TreeTableViewFocusModel(TreeTableView<S> treeTableView)
Creates a default TableViewFocusModel instance that will be used to
manage focus of the provided TableView control.
|
Modifier and Type | Method and Description |
---|---|
void |
focus(int index)
Causes the item at the given index to receive the focus.
|
void |
focus(int row,
TreeTableColumn<S,?> column)
Causes the item at the given index to receive the focus.
|
void |
focus(TreeTablePosition<S,?> pos)
Convenience method for setting focus on a particular row or cell
using a
TablePosition . |
void |
focusAboveCell()
Attempts to move focus to the cell above the currently focused cell.
|
void |
focusBelowCell()
Attempts to move focus to the cell below the currently focused cell.
|
<any> |
focusedCellProperty()
The position of the current item in the TableView which has the focus.
|
private <any> |
focusedCellPropertyImpl() |
void |
focusLeftCell()
Attempts to move focus to the cell to the left of the currently focused cell.
|
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.
|
void |
focusRightCell()
Attempts to move focus to the cell to the right of the the currently focused cell.
|
private int |
getColumnCount()
*
Private Implementation *
*
|
TreeTablePosition<S,?> |
getFocusedCell()
Gets the value of the property focusedCell.
|
protected int |
getItemCount()
Returns the number of items in the data model that underpins the control.
|
protected TreeItem<S> |
getModelItem(int index)
Returns the item at the given index.
|
private TreeTableColumn<S,?> |
getTableColumn(TreeTableColumn<S,?> column,
int offset) |
boolean |
isFocused(int row,
TreeTableColumn<S,?> column)
Tests whether the row / cell at the given location currently has the
focus within the TableView.
|
private void |
setFocusedCell(TreeTablePosition<S,?> value) |
private void |
updateTreeEventListener(TreeItem<S> oldRoot,
TreeItem<S> newRoot) |
focusedIndexProperty, focusedItemProperty, getFocusedIndex, getFocusedItem, isFocused, setFocusedIndex, setFocusedItem
public final <any> focusedCellProperty
getFocusedCell()
private final TreeTableView<S> treeTableView
private final TreeTablePosition EMPTY_CELL
private final <any> rootPropertyListener
private final <any> weakRootPropertyListener
private <any> treeItemListener
private <any> weakTreeItemListener
private <any> focusedCell
public TreeTableViewFocusModel(TreeTableView<S> treeTableView)
treeTableView
- The tableView upon which this focus model operates.java.lang.NullPointerException
- The TableView argument can not be null.private void updateTreeEventListener(TreeItem<S> oldRoot, TreeItem<S> newRoot)
protected int getItemCount()
listView.getItems().size()
. The valid range of focusable
indices is between 0 and whatever is returned by this method.getItemCount
in class FocusModel<TreeItem<S>>
protected TreeItem<S> getModelItem(int index)
listView.getItems().get(index)
.getModelItem
in class FocusModel<TreeItem<S>>
index
- The index of the item that is requested from the underlying
data model.public final <any> focusedCellProperty()
getFocusedCell()
private void setFocusedCell(TreeTablePosition<S,?> value)
public final TreeTablePosition<S,?> getFocusedCell()
private <any> focusedCellPropertyImpl()
public void focus(int row, TreeTableColumn<S,?> column)
focus
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
row
- The row index of the item to give focus to.column
- The column of the item to give focus to. Can be null.public void focus(TreeTablePosition<S,?> pos)
TablePosition
.pos
- The table position where focus should be set.public boolean isFocused(int row, TreeTableColumn<S,?> column)
isFocused
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
row
- the rowcolumn
- the columnpublic void focus(int index)
focusedIndex = -1
unless
0 <= index < model size
.focus
in class FocusModel<TreeItem<S>>
index
- The index of the item to get focus.public void focusAboveCell()
focusAboveCell
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
public void focusBelowCell()
focusBelowCell
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
public void focusLeftCell()
focusLeftCell
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
public void focusRightCell()
focusRightCell
in class TableFocusModel<TreeItem<S>,TreeTableColumn<S,?>>
public void focusPrevious()
focusPrevious
in class FocusModel<TreeItem<S>>
public void focusNext()
focusNext
in class FocusModel<TreeItem<S>>
private int getColumnCount()
private TreeTableColumn<S,?> getTableColumn(TreeTableColumn<S,?> column, int offset)