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 |
---|---|
ReadOnlyObjectProperty<TreeTablePosition<S,?>> |
focusedCell
The position of the current item in the TableView which has the focus.
|
focusedIndex, focusedItem
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.
|
ReadOnlyObjectProperty<TreeTablePosition<S,?>> |
focusedCellProperty()
The position of the current item in the TableView which has the focus.
|
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.
|
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.
|
boolean |
isFocused(int row,
TreeTableColumn<S,?> column)
Tests whether the row / cell at the given location currently has the
focus within the TableView.
|
focusedIndexProperty, focusedItemProperty, getFocusedIndex, getFocusedItem, isFocused
public final ReadOnlyObjectProperty<TreeTablePosition<S,?>> focusedCellProperty
getFocusedCell()
public TreeTableViewFocusModel(TreeTableView<S> treeTableView)
treeTableView
- The tableView upon which this focus model operates.NullPointerException
- The TableView argument can not be null.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 ReadOnlyObjectProperty<TreeTablePosition<S,?>> focusedCellProperty()
getFocusedCell()
public final TreeTablePosition<S,?> getFocusedCell()
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,?>>
public 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>>
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.