static class TreeView.TreeViewBitSetSelectionModel<T> extends MultipleSelectionModelBase<TreeItem<T>>
selectionModeProperty
selectedIndexProperty, selectedItemProperty
MultipleSelectionModelBase.SelectedIndicesList, MultipleSelectionModelBase.ShiftParams
Modifier and Type | Field and Description |
---|---|
private <any> |
rootPropertyListener |
private <any> |
treeItemListener |
private TreeView<T> |
treeView
*
Internal fields *
*
|
private <any> |
weakRootPropertyListener |
private <any> |
weakTreeItemListener |
selectedIndices, selectedItemChange
Constructor and Description |
---|
TreeViewBitSetSelectionModel(TreeView<T> treeView)
*
Constructors *
*
|
Modifier and Type | Method and Description |
---|---|
void |
clearAndSelect(int row)
A method that clears any selection prior to setting the selection to the
given index.
|
protected void |
focus(int itemIndex) |
protected int |
getFocusedIndex() |
protected int |
getItemCount()
Returns the number of items in the data model that underpins the control.
|
TreeItem<T> |
getModelItem(int index)
Returns the item at the given index.
|
void |
select(TreeItem<T> obj)
This method will attempt to select the index that contains the given
object.
|
void |
selectAll()
Convenience method to select all available indices.
|
private void |
updateDefaultSelection()
*
Private implementation *
*
|
private void |
updateTreeEventListener(TreeItem<T> oldRoot,
TreeItem<T> newRoot) |
clearSelection, clearSelection, getSelectedIndices, getSelectedItems, isAtomic, isEmpty, isSelected, select, selectFirst, selectIndices, selectLast, selectNext, selectPrevious, shiftSelection, shiftSelection, startAtomic, stopAtomic
getSelectionMode, selectionModeProperty, selectRange, setSelectionMode
getSelectedIndex, getSelectedItem, selectedIndexProperty, selectedItemProperty, setSelectedIndex, setSelectedItem
private <any> rootPropertyListener
private <any> treeItemListener
private <any> weakRootPropertyListener
private <any> weakTreeItemListener
private void updateTreeEventListener(TreeItem<T> oldRoot, TreeItem<T> newRoot)
public void selectAll()
Convenience method to select all available indices.
selectAll
in class MultipleSelectionModelBase<TreeItem<T>>
public void select(TreeItem<T> obj)
This method will attempt to select the index that contains the given object. It will iterate through the underlying data model until it finds an item whose value is equal to the given object. At this point it will stop iterating - this means that this method will not select multiple indices.
select
in class MultipleSelectionModelBase<TreeItem<T>>
obj
- The object to attempt to select in the underlying data model.public void clearAndSelect(int row)
SelectionModel.clearSelection()
first, meaning that observers that are listening to
the selected index
property will not
see the selected index being temporarily set to -1.clearAndSelect
in class MultipleSelectionModelBase<TreeItem<T>>
row
- The index that should be the only selected index in this
selection model.protected void focus(int itemIndex)
focus
in class MultipleSelectionModelBase<TreeItem<T>>
protected int getFocusedIndex()
getFocusedIndex
in class MultipleSelectionModelBase<TreeItem<T>>
protected int getItemCount()
listView.getItems().size()
. The valid range of selectable
indices is between 0 and whatever is returned by this method.getItemCount
in class MultipleSelectionModelBase<TreeItem<T>>
public TreeItem<T> getModelItem(int index)
listView.getItems().get(index)
.getModelItem
in class MultipleSelectionModelBase<TreeItem<T>>
index
- The index of the item that is requested from the underlying
data model.private void updateDefaultSelection()