SelectionModel to add API to support
multiple selection.
SelectionModel, SelectionMode
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | selectionMode
Specifies the selection mode to use in this selection model. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract ObservableList | Returns: the list of selected indicesReturns a read-only ObservableList of all selected indices. |
| public abstract ObservableList | Returns: the list of selected itemsReturns a read-only ObservableList of all selected items. |
| public final SelectionMode | |
| public abstract void | |
| public abstract void | selectFirst()
Implements abstract javafx. This method will attempt to select the first index in the control. |
| public abstract void | selectIndices(int
the first index to select index, int... zero or more additional indices to select indices)This method allows for one or more selections to be set at the same time. |
| public final ObjectProperty | |
| public abstract void | selectLast()
Implements abstract javafx. This method will attempt to select the last index in the control. |
| public void | selectRange(final int
The first index to select - this index will be selected. start, final int The last index of the selection - this index will not be selected. end)Selects all indices from the given start index to the item before the given end index. |
| public final void |
| selectionMode | back to summary |
|---|---|
| private ObjectProperty<SelectionMode> selectionMode Specifies the selection mode to use in this selection model. The selection mode specifies how many items in the underlying data model can be selected at any one time. By default, the selection mode is | |
| MultipleSelectionModel | back to summary |
|---|---|
| public MultipleSelectionModel() Creates a default MultipleSelectionModel instance. | |
| getSelectedIndices | back to summary |
|---|---|
| public abstract ObservableList Returns a read-only ObservableList of all selected indices. The
ObservableList will be updated by the selection model to always reflect
changes in selection. This can be observed by adding a
| |
| getSelectedItems | back to summary |
|---|---|
| public abstract ObservableList Returns a read-only ObservableList of all selected items. The
ObservableList will be updated further by the selection model to always reflect
changes in selection. This can be observed by adding a
| |
| getSelectionMode | back to summary |
|---|---|
| public final SelectionMode getSelectionMode() | |
| selectAll | back to summary |
|---|---|
| public abstract void selectAll() Convenience method to select all available indices. | |
| selectFirst | back to summary |
|---|---|
| public abstract void selectFirst() Implements abstract javafx. This method will attempt to select the first index in the control. If clearSelection is not called first, this method will have the result of selecting the first index, whilst retaining the selection of any other currently selected indices. If the first index is already selected, calling this method will have no result, and no selection event will take place.
| |
| selectIndices | back to summary |
|---|---|
| public abstract void selectIndices(int index, int... indices) This method allows for one or more selections to be set at the same time. It will ignore any value that is not within the valid range (i.e. greater than or equal to zero, and less than the total number of items in the underlying data model). Any duplication of indices will be ignored. If there is already one or more indices selected in this model, calling this method will not clear these selections - to do so it is necessary to first call clearSelection. The last valid value given will become the selected index / selected item.
| |
| selectionModeProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| selectLast | back to summary |
|---|---|
| public abstract void selectLast() Implements abstract javafx. This method will attempt to select the last index in the control. If clearSelection is not called first, this method will have the result of selecting the last index, whilst retaining the selection of any other currently selected indices. If the last index is already selected, calling this method will have no result, and no selection event will take place.
| |
| selectRange | back to summary |
|---|---|
| public void selectRange(final int start, final int end) Selects all indices from the given start index to the item before the given end index. This means that the selection is inclusive of the start index, and exclusive of the end index. This method will work regardless of whether start < end or start > end: the only constant is that the index before the given end index will become the selected index. If there is already one or more indices selected in this model, calling this method will not clear these selections - to do so it is necessary to first call clearSelection.
| |
| setSelectionMode | back to summary |
|---|---|
| public final void setSelectionMode(SelectionMode value) | |