static class ListView.ListViewBitSetSelectionModel<T> extends MultipleSelectionModelBase<T>
MultipleSelectionModelBase.BitSetReadOnlyUnbackedObservableList, MultipleSelectionModelBase.ShiftParams
Modifier and Type | Field and Description |
---|---|
private int |
itemCount |
private ListChangeListener<T> |
itemsContentObserver |
private InvalidationListener |
itemsObserver |
private ListView<T> |
listView
*
Internal properties *
*
|
private int |
previousModelSize |
private WeakListChangeListener<T> |
weakItemsContentObserver |
selectedIndices, selectedIndicesSeq, selectedItemChange
Constructor and Description |
---|
ListViewBitSetSelectionModel(ListView<T> listView)
*
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 row) |
protected int |
getFocusedIndex() |
protected int |
getItemCount()
Returns the number of items in the data model that underpins the control.
|
protected T |
getModelItem(int index)
Returns the item at the given index.
|
void |
selectAll()
Convenience method to select all available indices.
|
private void |
updateDefaultSelection() |
private void |
updateItemCount()
*
Private implementation *
*
|
private void |
updateItemsObserver(ObservableList<T> oldList,
ObservableList<T> newList) |
private void |
updateSelection(ListChangeListener.Change<? extends T> c) |
clearSelection, clearSelection, createRangeChange, getSelectedIndices, getSelectedItems, isAtomic, isEmpty, isSelected, select, select, selectFirst, selectIndices, selectLast, selectNext, selectPrevious, shiftSelection, startAtomic, stopAtomic
getSelectionMode, selectionModeProperty, selectRange, setSelectionMode
getSelectedIndex, getSelectedItem, selectedIndexProperty, selectedItemProperty, setSelectedIndex, setSelectedItem
private final ListChangeListener<T> itemsContentObserver
private final InvalidationListener itemsObserver
private WeakListChangeListener<T> weakItemsContentObserver
private int itemCount
private int previousModelSize
private void updateSelection(ListChangeListener.Change<? extends T> c)
public void selectAll()
Convenience method to select all available indices.
selectAll
in class MultipleSelectionModelBase<T>
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<T>
row
- The index that should be the only selected index in this
selection model.protected void focus(int row)
focus
in class MultipleSelectionModelBase<T>
protected int getFocusedIndex()
getFocusedIndex
in class MultipleSelectionModelBase<T>
protected int getItemCount()
MultipleSelectionModelBase
listView.getItems().size()
. The valid range of selectable
indices is between 0 and whatever is returned by this method.getItemCount
in class MultipleSelectionModelBase<T>
protected T getModelItem(int index)
MultipleSelectionModelBase
listView.getItems().get(index)
.getModelItem
in class MultipleSelectionModelBase<T>
index
- The index of the item that is requested from the underlying
data model.private void updateItemCount()
private void updateItemsObserver(ObservableList<T> oldList, ObservableList<T> newList)
private void updateDefaultSelection()