- Type Parameters:
- T- The type of the item contained in the control that can be selected.
- Direct Known Subclasses:
- TableSelectionModel
SelectionModel to add API to support
 multiple selection.- Since:
- JavaFX 2.0
- See Also:
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<SelectionMode>Specifies the selection mode to use in this selection model.Properties declared in class javafx.scene.control.SelectionModelselectedIndex, selectedItem
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract ObservableList<Integer>Returns a read-only ObservableList of all selected indices.abstract ObservableList<T>Returns a read-only ObservableList of all selected items.final SelectionModeGets the value of theselectionModeproperty.abstract voidConvenience method to select all available indices.abstract voidThis method will attempt to select the first index in the control.abstract voidselectIndices(int index, int... indices) This method allows for one or more selections to be set at the same time.final ObjectProperty<SelectionMode>Specifies the selection mode to use in this selection model.abstract voidThis method will attempt to select the last index in the control.voidselectRange(int start, int end) Selects all indices from the given start index to the item before the given end index.final voidsetSelectionMode(SelectionMode value) Sets the value of theselectionModeproperty.Methods declared in class javafx.scene.control.SelectionModelclearAndSelect, clearSelection, clearSelection, getSelectedIndex, getSelectedItem, isEmpty, isSelected, select, select, selectedIndexProperty, selectedItemProperty, selectNext, selectPrevious, setSelectedIndex, setSelectedItem
- 
Property Details- 
selectionModeSpecifies 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 SelectionMode.SINGLE.
 
- 
- 
Constructor Details- 
MultipleSelectionModelpublic MultipleSelectionModel()Creates a default MultipleSelectionModel instance.
 
- 
- 
Method Details- 
setSelectionModeSets the value of theselectionModeproperty.- Property description:
- 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 - SelectionMode.SINGLE.
- Parameters:
- value- the value for the- selectionModeproperty
- See Also:
 
- 
getSelectionModeGets the value of theselectionModeproperty.- Property description:
- 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 - SelectionMode.SINGLE.
- Returns:
- the value of the selectionModeproperty
- See Also:
 
- 
selectionModePropertySpecifies 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 SelectionMode.SINGLE.- Returns:
- the selectionModeproperty
- See Also:
 
- 
getSelectedIndicesReturns 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 ListChangeListenerto the returned ObservableList.- Returns:
- the list of selected indices
 
- 
getSelectedItemsReturns 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 ListChangeListenerto the returned ObservableList.- Returns:
- the list of selected items
 
- 
selectIndicespublic 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. - Parameters:
- index- the first index to select
- indices- zero or more additional indices to select
 
- 
selectRangepublic void selectRange(int start, 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. - Parameters:
- start- The first index to select - this index will be selected.
- end- The last index of the selection - this index will not be selected.
 
- 
selectAllpublic abstract void selectAll()Convenience method to select all available indices. 
- 
selectFirstpublic abstract void selectFirst()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. - Specified by:
- selectFirstin class- SelectionModel<T>
 
- 
selectLastpublic abstract void selectLast()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. - Specified by:
- selectLastin class- SelectionModel<T>
 
 
-