API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. DefaultListSelectionModel View Source
Author(s)
Philip Milne
Hans Muller
Since
Version
1.78 07/19/06
Serial
Hierarchy
 Object
      DefaultListSelectionModel
Implements
 ListSelectionModel
 Cloneable
 Serializable
Subclasses
Description
public class DefaultListSelectionModel
  Default data model for list selections.
See also:    ListSelectionModel
Constructors
public DefaultListSelectionModel ()
Methods
Hide/Show inherited methods
public void addListSelectionListener (ListSelectionListener l) [Specified in ListSelectionModel]
Add a listener to the list that's notified each time a change to the selection occurs.
public void addSelectionInterval (int index0, int index1) [Specified in ListSelectionModel]
  Changes the selection to be the set union of the current selection and the indices between index0 and index1 inclusive.
public void clearSelection () [Specified in ListSelectionModel]
  Change the selection to the empty set.
public Object clone () throws CloneNotSupportedException
  Returns a clone of this selection model with the same selection.
protected void fireValueChanged (boolean isAdjusting)
Notifies listeners that we have ended a series of adjustments.
protected void fireValueChanged (int firstIndex, int lastIndex)
Notifies ListSelectionListeners that the value of the selection, in the closed interval firstIndex, lastIndex, has changed.
protected void fireValueChanged (int firstIndex, int lastIndex, boolean isAdjusting)
 
public int getAnchorSelectionIndex () [Specified in ListSelectionModel]
  Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
public int getLeadSelectionIndex () [Specified in ListSelectionModel]
Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
public T getListeners (Class< T> listenerType)
  Returns an array of all the objects currently registered as FooListeners upon this model.
public ListSelectionListener getListSelectionListeners ()
  Returns an array of all the list selection listeners registered on this DefaultListSelectionModel.
public int getMaxSelectionIndex () [Specified in ListSelectionModel]
Returns the last selected index or -1 if the selection is empty.
public int getMinSelectionIndex () [Specified in ListSelectionModel]
Returns the first selected index or -1 if the selection is empty.
public int getSelectionMode () [Specified in ListSelectionModel]
Returns the current selection mode.
public boolean getValueIsAdjusting () [Specified in ListSelectionModel]
Returns true if the selection is undergoing a series of changes.
public void insertIndexInterval (int index, int length, boolean before) [Specified in ListSelectionModel]
  Insert length indices beginning before/after index.
public boolean isLeadAnchorNotificationEnabled ()
  Returns the value of the leadAnchorNotificationEnabled flag.
public boolean isSelectedIndex (int index) [Specified in ListSelectionModel]
Returns true if the specified index is selected.
public boolean isSelectionEmpty () [Specified in ListSelectionModel]
Returns true if no indices are selected.
public void moveLeadSelectionIndex (int leadIndex)
  Set the lead selection index, leaving all selection values unchanged.
public void removeIndexInterval (int index0, int index1) [Specified in ListSelectionModel]
  Remove the indices in the interval index0,index1 (inclusive) from the selection model.
public void removeListSelectionListener (ListSelectionListener l) [Specified in ListSelectionModel]
Remove a listener from the list that's notified each time a change to the selection occurs.
public void removeSelectionInterval (int index0, int index1) [Specified in ListSelectionModel]
  Changes the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive.
public void setAnchorSelectionIndex (int anchorIndex) [Specified in ListSelectionModel]
  Set the anchor selection index, leaving all selection values unchanged.
public void setLeadAnchorNotificationEnabled (boolean flag)
  Sets the value of the leadAnchorNotificationEnabled flag.
public void setLeadSelectionIndex (int leadIndex) [Specified in ListSelectionModel]
  Sets the lead selection index, ensuring that values between the anchor and the new lead are either all selected or all deselected.
public void setSelectionInterval (int index0, int index1) [Specified in ListSelectionModel]
  Changes the selection to be between index0 and index1 inclusive.
public void setSelectionMode (int selectionMode) [Specified in ListSelectionModel]
  Sets the selection mode.
public void setValueIsAdjusting (boolean isAdjusting) [Specified in ListSelectionModel]
  Sets the valueIsAdjusting property, which indicates whether or not upcoming selection changes should be considered part of a single change.
public String toString ()
  Returns a string that displays and identifies this object's properties.
Fields
Hide/Show inherited fields
protected boolean leadAnchorNotificationEnabled
protected EventListenerList listenerList
publicfinalstatic int MULTIPLE_INTERVAL_SELECTION = "2" [Inherited From ListSelectionModel]
  A value for the selectionMode property: select one or more contiguous ranges of indices at a time.
publicfinalstatic int SINGLE_INTERVAL_SELECTION = "1" [Inherited From ListSelectionModel]
  A value for the selectionMode property: select one contiguous range of indices at a time.
publicfinalstatic int SINGLE_SELECTION = "0" [Inherited From ListSelectionModel]
  A value for the selectionMode property: select one list index at a time.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar