API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. ListSelectionModel View Source
Author(s)
Hans Muller
Philip Milne
Since
Version
1.23 07/11/06
Serial
Hierarchy
 ListSelectionModel
Subinterfaces
Description
public interface ListSelectionModel
  This interface represents the current state of the selection for any of the components that display a list of values with stable indices.
See also:    DefaultListSelectionModel
Methods
Hide/Show inherited methods
public void addListSelectionListener (ListSelectionListener x)
  Add a listener to the list that's notified each time a change to the selection occurs.
public void addSelectionInterval (int index0, int index1)
  Changes the selection to be the set union of the current selection and the indices between index0 and index1 inclusive.
public void clearSelection ()
  Change the selection to the empty set.
public int getAnchorSelectionIndex ()
  Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
public int getLeadSelectionIndex ()
  Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
public int getMaxSelectionIndex ()
Returns the last selected index or -1 if the selection is empty.
public int getMinSelectionIndex ()
Returns the first selected index or -1 if the selection is empty.
public int getSelectionMode ()
  Returns the current selection mode.
public boolean getValueIsAdjusting ()
  Returns true if the selection is undergoing a series of changes.
public void insertIndexInterval (int index, int length, boolean before)
  Insert length indices beginning before/after index.
public boolean isSelectedIndex (int index)
Returns true if the specified index is selected.
public boolean isSelectionEmpty ()
Returns true if no indices are selected.
public void removeIndexInterval (int index0, int index1)
  Remove the indices in the interval index0,index1 (inclusive) from the selection model.
public void removeListSelectionListener (ListSelectionListener x)
  Remove a listener from the list that's notified each time a change to the selection occurs.
public void removeSelectionInterval (int index0, int index1)
  Changes the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive.
public void setAnchorSelectionIndex (int index)
  Set the anchor selection index.
public void setLeadSelectionIndex (int index)
  Set the lead selection index.
public void setSelectionInterval (int index0, int index1)
  Changes the selection to be between index0 and index1 inclusive.
public void setSelectionMode (int selectionMode)
  Sets the selection mode.
public void setValueIsAdjusting (boolean valueIsAdjusting)
  Sets the valueIsAdjusting property, which indicates whether or not upcoming selection changes should be considered part of a single change.
Fields
Hide/Show inherited fields
publicfinalstatic int MULTIPLE_INTERVAL_SELECTION = "2"
  A value for the selectionMode property: select one or more contiguous ranges of indices at a time.
publicfinalstatic int SINGLE_INTERVAL_SELECTION = "1"
  A value for the selectionMode property: select one contiguous range of indices at a time.
publicfinalstatic int SINGLE_SELECTION = "0"
  A value for the selectionMode property: select one list index at a time.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar