| Modifier and Type | Field and Description |
|---|---|
| private ReadOnlyIntegerWrapper | |
| private ReadOnlyObjectWrapper |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | clearAndSelect(int
The index that should be the only selected index in this
selection model. index)A method that clears any selection prior to setting the selection to the given index. |
| public abstract void | clearSelection(int
The selected item to deselect. index)This method will clear the selection of the item in the given index. |
| public abstract void | |
| public final int | Returns: the selected indexReturns the integer value indicating the currently selected index in this model. |
| public final T | Returns: the selected itemReturns the currently selected object (which resides in the selected index position). |
| public abstract boolean | Returns: Will return true if there are no selected items, and false if there are.This method is available to test whether there are any selected indices/items. |
| public abstract boolean | Returns: True if the given index is selected, false otherwise.The index to check as to whether it is currently selected
or not. index)This method tests whether the given index is currently selected in this SelectionModel. |
| public abstract void | select(int
The position of the item to select in the selection model. index)This will select the given index in the selection model, assuming the index is 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). |
| public abstract void | select(T
The object to attempt to select in the underlying data model. obj)This method will attempt to select the index that contains the given object. |
| public final ReadOnlyIntegerProperty | Returns: the selected index propertyRefers to the selected index property, which is used to indicate the currently selected index value in the selection model. |
| public final ReadOnlyObjectProperty | Returns: the selected item propertyRefers to the selected item property, which is used to indicate the currently selected item in the selection model. |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | selectPrevious()
This method will attempt to select the index directly before the current focused index. |
| protected final void | |
| protected final void |
| selectedIndex | back to summary |
|---|---|
| private ReadOnlyIntegerWrapper selectedIndex | |
| selectedItem | back to summary |
|---|---|
| private ReadOnlyObjectWrapper<T> selectedItem | |
| SelectionModel | back to summary |
|---|---|
| public SelectionModel() Creates a default SelectionModel instance. | |
| clearAndSelect | back to summary |
|---|---|
| public abstract void clearAndSelect(int index) A method that clears any selection prior to setting the selection to the
given index. The purpose of this method is to avoid having to call
| |
| clearSelection | back to summary |
|---|---|
| public abstract void clearSelection(int index) This method will clear the selection of the item in the given index. If the given index is not selected, nothing will happen.
| |
| clearSelection | back to summary |
|---|---|
| public abstract void clearSelection() Clears the selection model of all selected indices. | |
| getSelectedIndex | back to summary |
|---|---|
| public final int getSelectedIndex() Returns the integer value indicating the currently selected index in this model. If there are multiple items selected, this will return the most recent selection made. Note that the returned value is a snapshot in time - if you wish to observe the selection model for changes to the selected index, you can add a ChangeListener as such:
| |
| getSelectedItem | back to summary |
|---|---|
| public final T getSelectedItem() Returns the currently selected object (which resides in the selected index position). If there are multiple items selected, this will return the object contained at the index returned by getSelectedIndex() (which is always the index to the most recently selected item). Note that the returned value is a snapshot in time - if you wish to observe the selection model for changes to the selected item, you can add a ChangeListener as such:
| |
| isEmpty | back to summary |
|---|---|
| public abstract boolean isEmpty() This method is available to test whether there are any selected indices/items. It will return true if there are no selected items, and false if there are.
| |
| isSelected | back to summary |
|---|---|
| public abstract boolean isSelected(int index) This method tests whether the given index is currently selected in this SelectionModel.
| |
| select | back to summary |
|---|---|
| public abstract void select(int index) This will select the given index in the selection model, assuming the index is 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). 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 If the index is already selected, it will not be selected again, or
unselected. However, if multiple selection is implemented, then calling
select on an already selected index will have the effect of making the index
the new selected index (as returned by
| |
| select | back to summary |
|---|---|
| public abstract void select(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.
| |
| selectedIndexProperty | back to summary |
|---|---|
| public final ReadOnlyIntegerProperty selectedIndexProperty() Refers to the selected index property, which is used to indicate the currently selected index value in the selection model. The selected index is either -1, to represent that there is no selection, or an integer value that is within the range of the underlying data model size. The selected index property is most commonly used when the selection model only allows single selection, but is equally applicable when in multiple selection mode. When in this mode, the selected index will always represent the last selection made. Note that in the case of multiple selection, it is possible to add
a
| |
| selectedItemProperty | back to summary |
|---|---|
| public final ReadOnlyObjectProperty Refers to the selected item property, which is used to indicate the currently selected item in the selection model. The selected item is either null, to represent that there is no selection, or an Object that is retrieved from the underlying data model of the control the selection model is associated with. The selected item property is most commonly used when the selection model is set to be single selection, but is equally applicable when in multiple selection mode. When in this mode, the selected item will always represent the last selection made.
| |
| selectFirst | back to summary |
|---|---|
| public 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. | |
| selectLast | back to summary |
|---|---|
| public 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. | |
| selectNext | back to summary |
|---|---|
| public abstract void selectNext() This method will attempt to select the index directly after the current focused index. If clearSelection is not called first, this method will have the result of selecting the next index, whilst retaining the selection of any other currently selected indices. Calling this method will only succeed if:
If any of these conditions is false, no selection event will take place. | |
| selectPrevious | back to summary |
|---|---|
| public abstract void selectPrevious() This method will attempt to select the index directly before the current focused index. If clearSelection is not called first, this method will have the result of selecting the previous index, whilst retaining the selection of any other currently selected indices. Calling this method will only succeed if:
If any of these conditions is false, no selection event will take place. | |
| setSelectedIndex | back to summary |
|---|---|
| protected final void setSelectedIndex(int value) | |
| setSelectedItem | back to summary |
|---|---|
| protected final void setSelectedItem(T value) | |