DefaultListSelectionModel
Modifier and Type | Field and Description |
---|---|
public static final int | MULTIPLE_INTERVAL_SELECTION
A value for the selectionMode property: select one or more contiguous ranges of indices at a time. |
public static final int | SINGLE_INTERVAL_SELECTION
A value for the selectionMode property: select one contiguous range of indices at a time. |
public static final int | SINGLE_SELECTION
A value for the selectionMode property: select one list index at a time. |
Modifier and Type | Method and Description |
---|---|
public void | addListSelectionListener(ListSelectionListener
the ListSelectionListener x)Add a listener to the list that's notified each time a change to the selection occurs. |
public void | addSelectionInterval(int
one end of the interval. index0, int other end of the interval index1)Changes the selection to be the set union of the current selection
and the indices between |
public void | |
public int | Returns: the anchor selection indexReturn the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). |
public int | Returns: the lead selection index.Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). |
public int | Returns: the last selected index or -1 if the selection is empty.Returns the last selected index or -1 if the selection is empty. |
public int | Returns: the first selected index or -1 if the selection is empty.Returns the first selected index or -1 if the selection is empty. |
public default int[] | Returns: all of the selected indices, in increasing order, or an empty array if nothing is selectedReturns an array of all of the selected indices in the selection model, in increasing order. |
public default int | Returns: the number of selected items, 0 if no items are selectedReturns the number of selected items. |
public int | |
public boolean | Returns: true if the selection is undergoing a series of changesReturns |
public void | insertIndexInterval(int
the beginning of the interval index, int the length of the interval length, boolean if before)true , interval inserts before the index ,
otherwise, interval inserts after the index Insert |
public boolean | Returns: true if the specified index is selectedan index index)Returns true if the specified index is selected. |
public boolean | |
public void | removeIndexInterval(int
the beginning of the interval index0, int the end of the interval index1)Remove the indices in the interval |
public void | removeListSelectionListener(ListSelectionListener
the ListSelectionListener x)Remove a listener from the list that's notified each time a change to the selection occurs. |
public void | removeSelectionInterval(int
one end of the interval. index0, int other end of the interval index1)Changes the selection to be the set difference of the current selection
and the indices between |
public void | |
public void | |
public void | setSelectionInterval(int
one end of the interval. index0, int other end of the interval index1)Changes the selection to be between |
public void | |
public void | setValueIsAdjusting(boolean
the new value of the property valueIsAdjusting)Sets the |
MULTIPLE_INTERVAL_SELECTION | back to summary |
---|---|
public static final int MULTIPLE_INTERVAL_SELECTION A value for the selectionMode property: select one or more contiguous ranges of indices at a time.
|
SINGLE_INTERVAL_SELECTION | back to summary |
---|---|
public static final int SINGLE_INTERVAL_SELECTION A value for the selectionMode property: select one contiguous range of indices at a time.
|
SINGLE_SELECTION | back to summary |
---|---|
public static final int SINGLE_SELECTION A value for the selectionMode property: select one list index at a time.
|
addListSelectionListener | back to summary |
---|---|
public void addListSelectionListener(ListSelectionListener x) Add a listener to the list that's notified each time a change to the selection occurs.
|
addSelectionInterval | back to summary |
---|---|
public void addSelectionInterval(int index0, int index1) Changes the selection to be the set union of the current selection
and the indices between
In
If this represents a change to the current selection, then each
|
clearSelection | back to summary |
---|---|
public void clearSelection() Change the selection to the empty set. If this represents a change to the current selection then notify each ListSelectionListener.
|
getAnchorSelectionIndex | back to summary |
---|---|
public int getAnchorSelectionIndex() Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). The most recent index0 is considered the "anchor" and the most recent index1 is considered the "lead". Some interfaces display these indices specially, e.g. Windows95 displays the lead index with a dotted yellow outline.
|
getLeadSelectionIndex | back to summary |
---|---|
public int getLeadSelectionIndex() Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
|
getMaxSelectionIndex | back to summary |
---|---|
public int getMaxSelectionIndex() Returns the last selected index or -1 if the selection is empty.
|
getMinSelectionIndex | back to summary |
---|---|
public int getMinSelectionIndex() Returns the first selected index or -1 if the selection is empty.
|
getSelectedIndices | back to summary |
---|---|
public default int[] getSelectedIndices() Returns an array of all of the selected indices in the selection model, in increasing order. Implementation Specification The default implementation iterates from minimum selected
index
|
getSelectedItemsCount | back to summary |
---|---|
public default int getSelectedItemsCount() Returns the number of selected items. Implementation Specification The default implementation iterates from minimum selected
index
|
getSelectionMode | back to summary |
---|---|
public int getSelectionMode() Returns the current selection mode.
|
getValueIsAdjusting | back to summary |
---|---|
public boolean getValueIsAdjusting() Returns
|
insertIndexInterval | back to summary |
---|---|
public void insertIndexInterval(int index, int length, boolean before) Insert
|
isSelectedIndex | back to summary |
---|---|
public boolean isSelectedIndex(int index) Returns true if the specified index is selected.
|
isSelectionEmpty | back to summary |
---|---|
public boolean isSelectionEmpty() Returns true if no indices are selected.
|
removeIndexInterval | back to summary |
---|---|
public void removeIndexInterval(int index0, int index1) Remove the indices in the interval
|
removeListSelectionListener | back to summary |
---|---|
public void removeListSelectionListener(ListSelectionListener x) Remove a listener from the list that's notified each time a change to the selection occurs.
|
removeSelectionInterval | back to summary |
---|---|
public void removeSelectionInterval(int index0, int index1) Changes the selection to be the set difference of the current selection
and the indices between
In
If this represents a change to the current selection, then each
|
setAnchorSelectionIndex | back to summary |
---|---|
public void setAnchorSelectionIndex(int index) Set the anchor selection index.
|
setLeadSelectionIndex | back to summary |
---|---|
public void setLeadSelectionIndex(int index) Set the lead selection index.
|
setSelectionInterval | back to summary |
---|---|
public void setSelectionInterval(int index0, int index1) Changes the selection to be between
In
If this represents a change to the current selection, then each
|
setSelectionMode | back to summary |
---|---|
public void setSelectionMode(int selectionMode) Sets the selection mode. The following list describes the accepted selection modes:
|
setValueIsAdjusting | back to summary |
---|---|
public void setValueIsAdjusting(boolean valueIsAdjusting) Sets the
For example, if the selection is being updated in response to a user
drag, this property can be set to
Setting this property to
|