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, setSelectedIndexModifier and TypeMethodDescriptionvoidInvoked to indicate interest in future change eventsvoidAdds the specified item to the end of this list.voidInvoked to indicate interest in future selection eventsgetItemAt(int index) Returns the item at the given offsetintReturns the selected list offsetintgetSize()Returns the number of items in the listvoidInvoked to indicate no further interest in future change eventsvoidremoveItem(int index) Removes the item at the specified position in this list.voidInvoked to indicate no further interest in future selection eventsvoidsetSelectedIndex(int index) Sets the selected list offset can be set to -1 to clear selection
-
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
-