Interface MultipleSelectionListModel<T>
- All Superinterfaces:
ListModel<T>
- All Known Implementing Classes:
ContactsModel, DefaultListModel
Events
ListModel to support multiple selection.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectedIndices(int... indices) Adds indices to set of selected indices.int[]Gets the selected indices in this model.voidremoveSelectedIndices(int... indices) Removes indices from the set of selected indices.voidsetSelectedIndices(int... indices) Sets the selected indices in this model.Methods inherited from interface ListModel
addDataChangedListener, addItem, addSelectionListener, getItemAt, getSelectedIndex, getSize, removeDataChangedListener, removeItem, removeSelectionListener, setSelectedIndex
-
Method Details
-
addSelectedIndices
void addSelectedIndices(int... indices) Adds indices to set of selected indices.
Parameters
indices: Indices to add to selected indices.
-
removeSelectedIndices
void removeSelectedIndices(int... indices) Removes indices from the set of selected indices.
Parameters
indices: Indices to remove from selected indices.
-
getSelectedIndices
int[] getSelectedIndices()Gets the selected indices in this model. Indices should be returned in increasing order with no duplicates.
Returns
- Returns:
- Selected indices in increasing order with no duplicates. If there are no selected indices, then this will return a zero-length array.
-
setSelectedIndices
void setSelectedIndices(int... indices) Sets the selected indices in this model.
Parameters
indices
-