JIDE 3.5.15

com.jidesoft.list
Class DefaultDisableableListSelectionModel

java.lang.Object
  extended by javax.swing.DefaultListSelectionModel
      extended by com.jidesoft.list.DefaultDisableableListSelectionModel
All Implemented Interfaces:
Serializable, Cloneable, ListSelectionModel

public class DefaultDisableableListSelectionModel
extends DefaultListSelectionModel

See Also:
Serialized Form

Field Summary
protected  DefaultListSelectionModel _delegate
           
protected  Set<Integer> _disabledIndices
           
 
Fields inherited from class javax.swing.DefaultListSelectionModel
leadAnchorNotificationEnabled, listenerList
 
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
DefaultDisableableListSelectionModel()
          Creates an instance of DefaultDisableableListSelectionModel
 
Method Summary
 void addDisabledSelectionInterval(int index0, int index1)
          Change the disabled selection to be the set union of the current selection and the indices between index0 and index1 inclusive.
 void addListSelectionListener(ListSelectionListener l)
          
 void addSelectionInterval(int index0, int index1)
          
 void clearSelection()
          
 DefaultDisableableListSelectionModel clone()
          
 int getAnchorSelectionIndex()
          
 int[] getDisabledIndices()
          Returns the indices that are not allowed selecting
 int getLeadSelectionIndex()
          
<T extends EventListener>
T[]
getListeners(Class<T> listenerType)
          
 ListSelectionListener[] getListSelectionListeners()
          
 int getMaxSelectionIndex()
          
 int getMinSelectionIndex()
          
 int getSelectionMode()
          
 boolean getValueIsAdjusting()
          
 void insertIndexInterval(int index, int length, boolean before)
          
 boolean isLeadAnchorNotificationEnabled()
          
 boolean isSelectedIndex(int index)
          
 boolean isSelectionEmpty()
          
 void moveLeadSelectionIndex(int leadIndex)
          
protected  int originalGetMaxSelectionIndex()
           
protected  int originalGetMinSelectionIndex()
           
protected  boolean originalIsSelectedIndex(int index)
           
protected  boolean originalIsSelectionEmpty()
           
 void removeDisabledIndexInterval(int index0, int index1)
          Remove the disabled indices in the interval index0,index1 (inclusive) from the selection model.
 void removeDisabledSelectionInterval(int index0, int index1)
          Change the disabled selection to be the set difference of the current selection and the indices between index0 and index1 inclusive.
 void removeIndexInterval(int index0, int index1)
          
 void removeListSelectionListener(ListSelectionListener l)
          
 void removeSelectionInterval(int index0, int index1)
          
 void setAnchorSelectionIndex(int anchorIndex)
          
 void setDisabledIndices(int[] disabledIndices)
          Set indices that are not allowed selecting
 void setDisabledSelectionInterval(int index0, int index1)
          Change the disabled selection to be between index0 and index1 inclusive.
 void setLeadAnchorNotificationEnabled(boolean flag)
          
 void setLeadSelectionIndex(int leadIndex)
          
 void setSelectionInterval(int index0, int index1)
          
 void setSelectionMode(int selectionMode)
          
 void setValueIsAdjusting(boolean isAdjusting)
          
 String toString()
          
 
Methods inherited from class javax.swing.DefaultListSelectionModel
fireValueChanged, fireValueChanged, fireValueChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_disabledIndices

protected Set<Integer> _disabledIndices

_delegate

protected DefaultListSelectionModel _delegate
Constructor Detail

DefaultDisableableListSelectionModel

public DefaultDisableableListSelectionModel()
Creates an instance of DefaultDisableableListSelectionModel

Method Detail

setDisabledIndices

public void setDisabledIndices(int[] disabledIndices)
Set indices that are not allowed selecting

Parameters:
disabledIndices - indices that are not allowed selecting
See Also:
setDisabledSelectionInterval(int,int), getDisabledIndices()

setDisabledSelectionInterval

public void setDisabledSelectionInterval(int index0,
                                         int index1)
Change the disabled selection to be between index0 and index1 inclusive. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
setDisabledIndices(int[]), setSelectionInterval(int,int)

addDisabledSelectionInterval

public void addDisabledSelectionInterval(int index0,
                                         int index1)
Change the disabled selection to be the set union of the current selection and the indices between index0 and index1 inclusive. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
addSelectionInterval(int,int)

removeDisabledSelectionInterval

public void removeDisabledSelectionInterval(int index0,
                                            int index1)
Change the disabled selection to be the set difference of the current selection and the indices between index0 and index1 inclusive. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
removeSelectionInterval(int,int), removeDisabledIndexInterval(int,int)

removeDisabledIndexInterval

public void removeDisabledIndexInterval(int index0,
                                        int index1)
Remove the disabled indices in the interval index0,index1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
removeIndexInterval(int,int), removeDisabledSelectionInterval(int,int)

getDisabledIndices

public int[] getDisabledIndices()
Returns the indices that are not allowed selecting

Returns:
the indices that are not allowed selecting
See Also:
setDisabledIndices(int[])

isSelectedIndex

public boolean isSelectedIndex(int index)

Specified by:
isSelectedIndex in interface ListSelectionModel
Overrides:
isSelectedIndex in class DefaultListSelectionModel

isSelectionEmpty

public boolean isSelectionEmpty()

Specified by:
isSelectionEmpty in interface ListSelectionModel
Overrides:
isSelectionEmpty in class DefaultListSelectionModel

getMinSelectionIndex

public int getMinSelectionIndex()

Specified by:
getMinSelectionIndex in interface ListSelectionModel
Overrides:
getMinSelectionIndex in class DefaultListSelectionModel

getMaxSelectionIndex

public int getMaxSelectionIndex()

Specified by:
getMaxSelectionIndex in interface ListSelectionModel
Overrides:
getMaxSelectionIndex in class DefaultListSelectionModel

originalGetMinSelectionIndex

protected int originalGetMinSelectionIndex()

originalGetMaxSelectionIndex

protected int originalGetMaxSelectionIndex()

getValueIsAdjusting

public boolean getValueIsAdjusting()

Specified by:
getValueIsAdjusting in interface ListSelectionModel
Overrides:
getValueIsAdjusting in class DefaultListSelectionModel

getSelectionMode

public int getSelectionMode()

Specified by:
getSelectionMode in interface ListSelectionModel
Overrides:
getSelectionMode in class DefaultListSelectionModel

setSelectionMode

public void setSelectionMode(int selectionMode)

Specified by:
setSelectionMode in interface ListSelectionModel
Overrides:
setSelectionMode in class DefaultListSelectionModel

originalIsSelectedIndex

protected boolean originalIsSelectedIndex(int index)

originalIsSelectionEmpty

protected boolean originalIsSelectionEmpty()

addListSelectionListener

public void addListSelectionListener(ListSelectionListener l)

Specified by:
addListSelectionListener in interface ListSelectionModel
Overrides:
addListSelectionListener in class DefaultListSelectionModel

removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener l)

Specified by:
removeListSelectionListener in interface ListSelectionModel
Overrides:
removeListSelectionListener in class DefaultListSelectionModel

getListSelectionListeners

public ListSelectionListener[] getListSelectionListeners()

Overrides:
getListSelectionListeners in class DefaultListSelectionModel

getListeners

public <T extends EventListener> T[] getListeners(Class<T> listenerType)

Overrides:
getListeners in class DefaultListSelectionModel

setLeadAnchorNotificationEnabled

public void setLeadAnchorNotificationEnabled(boolean flag)

Overrides:
setLeadAnchorNotificationEnabled in class DefaultListSelectionModel

isLeadAnchorNotificationEnabled

public boolean isLeadAnchorNotificationEnabled()

Overrides:
isLeadAnchorNotificationEnabled in class DefaultListSelectionModel

clearSelection

public void clearSelection()

Specified by:
clearSelection in interface ListSelectionModel
Overrides:
clearSelection in class DefaultListSelectionModel

setSelectionInterval

public void setSelectionInterval(int index0,
                                 int index1)

Specified by:
setSelectionInterval in interface ListSelectionModel
Overrides:
setSelectionInterval in class DefaultListSelectionModel

addSelectionInterval

public void addSelectionInterval(int index0,
                                 int index1)

Specified by:
addSelectionInterval in interface ListSelectionModel
Overrides:
addSelectionInterval in class DefaultListSelectionModel

removeSelectionInterval

public void removeSelectionInterval(int index0,
                                    int index1)

Specified by:
removeSelectionInterval in interface ListSelectionModel
Overrides:
removeSelectionInterval in class DefaultListSelectionModel

insertIndexInterval

public void insertIndexInterval(int index,
                                int length,
                                boolean before)

Specified by:
insertIndexInterval in interface ListSelectionModel
Overrides:
insertIndexInterval in class DefaultListSelectionModel

removeIndexInterval

public void removeIndexInterval(int index0,
                                int index1)

Specified by:
removeIndexInterval in interface ListSelectionModel
Overrides:
removeIndexInterval in class DefaultListSelectionModel

setValueIsAdjusting

public void setValueIsAdjusting(boolean isAdjusting)

Specified by:
setValueIsAdjusting in interface ListSelectionModel
Overrides:
setValueIsAdjusting in class DefaultListSelectionModel

toString

public String toString()

Overrides:
toString in class DefaultListSelectionModel

clone

public DefaultDisableableListSelectionModel clone()

Overrides:
clone in class DefaultListSelectionModel

getAnchorSelectionIndex

public int getAnchorSelectionIndex()

Specified by:
getAnchorSelectionIndex in interface ListSelectionModel
Overrides:
getAnchorSelectionIndex in class DefaultListSelectionModel

getLeadSelectionIndex

public int getLeadSelectionIndex()

Specified by:
getLeadSelectionIndex in interface ListSelectionModel
Overrides:
getLeadSelectionIndex in class DefaultListSelectionModel

setAnchorSelectionIndex

public void setAnchorSelectionIndex(int anchorIndex)

Specified by:
setAnchorSelectionIndex in interface ListSelectionModel
Overrides:
setAnchorSelectionIndex in class DefaultListSelectionModel

moveLeadSelectionIndex

public void moveLeadSelectionIndex(int leadIndex)

Overrides:
moveLeadSelectionIndex in class DefaultListSelectionModel

setLeadSelectionIndex

public void setLeadSelectionIndex(int leadIndex)

Specified by:
setLeadSelectionIndex in interface ListSelectionModel
Overrides:
setLeadSelectionIndex in class DefaultListSelectionModel

JIDE 3.5.15