com.sas.swing.visuals
Class CheckBoxListSelectionModel

com.sas.swing.visuals.CheckBoxListSelectionModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.ListSelectionModel
Direct Known Subclasses:
TriStateCheckBoxListSelectionModel

public class CheckBoxListSelectionModel

Default data model for CheckBoxList selections. Instead of setting a new selection no matter what their currently selected state is as in regular listboxes, new selections should be added or removed from the selection list based on their current selection state. If they are not currently selected and than they are selected, then they should be selected. If they are currently selected and then they are selected again, then they should be deselected.

See Also:
CheckBoxList, Serialized Form

Field Summary
protected  boolean isAdjusting
          flag for an event trying to modify the selection model such as a mouse drag
static java.lang.String RB_KEY
           
protected  int selectionMode
           
 
Constructor Summary
CheckBoxListSelectionModel()
           
 
Method Summary
 boolean getValueIsAdjusting()
          Return whether changes are being made to the model.
 void setSelectionInterval(int index0, int index1)
          Add or remove the new selection interval based on current selected state
 void setSelectionMode(int selectionMode)
          Sets the selection mode.
 void setValueIsAdjusting(boolean isAdjusting)
          Set whether changes are being made to the model.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

isAdjusting

protected boolean isAdjusting
flag for an event trying to modify the selection model such as a mouse drag


selectionMode

protected int selectionMode
Constructor Detail

CheckBoxListSelectionModel

public CheckBoxListSelectionModel()
Method Detail

setSelectionInterval

public void setSelectionInterval(int index0,
                                 int index1)
Add or remove the new selection interval based on current selected state

Specified by:
setSelectionInterval in interface javax.swing.ListSelectionModel
Overrides:
setSelectionInterval in class javax.swing.DefaultListSelectionModel
Parameters:
index0 - starting index of the selection
index1 - ending index of the selection

setSelectionMode

public void setSelectionMode(int selectionMode)
Sets the selection mode. The default value for the CheckBoxList is MULTIPLE_INTERVAL_SELECTION. SINGLE_SELECTION is also allowed.

Specified by:
setSelectionMode in interface javax.swing.ListSelectionModel
Overrides:
setSelectionMode in class javax.swing.DefaultListSelectionModel
Throws:
java.lang.IllegalArgumentException - if selectionMode is not MULTIPLE_INTERVAL_SELECTION or SINGLE_SELECTION.
See Also:
setSelectionMode(int)

setValueIsAdjusting

public void setValueIsAdjusting(boolean isAdjusting)
Set whether changes are being made to the model.

Specified by:
setValueIsAdjusting in interface javax.swing.ListSelectionModel
Overrides:
setValueIsAdjusting in class javax.swing.DefaultListSelectionModel
Parameters:
isAdjusting - The new value of the property.

getValueIsAdjusting

public boolean getValueIsAdjusting()
Return whether changes are being made to the model.

Specified by:
getValueIsAdjusting in interface javax.swing.ListSelectionModel
Overrides:
getValueIsAdjusting in class javax.swing.DefaultListSelectionModel
Returns:
true if the value is currently adjusting



Copyright © 2009 SAS Institute Inc. All Rights Reserved.