Package com.jidesoft.swing
Class CheckBoxListSelectionModel
java.lang.Object
javax.swing.DefaultListSelectionModel
com.jidesoft.swing.CheckBoxListSelectionModel
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,ListDataListener,ListSelectionModel
public class CheckBoxListSelectionModel
extends DefaultListSelectionModel
implements ListDataListener
- See Also:
-
Field Summary
Fields inherited from class javax.swing.DefaultListSelectionModel
leadAnchorNotificationEnabled, listenerListFields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectionInterval(int index0, int index1) voidintGets the index of the "all" entry in the CheckBoxList.intgetModel()voidinsertIndexInterval(int index, int length, boolean before) Overrides so that inserting a row will not be selected automatically if the row after it is selected.voidvoidbooleanGets the flag indicating if this CheckBoxListSelectionModel should consider the CheckBoxList.ALL item if there is one.booleanisSelectedIndex(int index) voidremoveSelectionInterval(int index0, int index1) voidsetAllEntryConsidered(boolean allEntryConsidered) Sets the flag indicating if this CheckBoxListSelectionModel should consider the CheckBoxList.ALL item if there is one.voidsetAllEntryIndex(int allEntryIndex) Sets the index of the "all" entry in the CheckBoxList.voidvoidsetSelectionInterval(int index0, int index1) protected voidMethods inherited from class javax.swing.DefaultListSelectionModel
addListSelectionListener, clearSelection, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getSelectionMode, getValueIsAdjusting, isLeadAnchorNotificationEnabled, isSelectionEmpty, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionMode, setValueIsAdjusting, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.swing.ListSelectionModel
getSelectedIndices, getSelectedItemsCount
-
Constructor Details
-
CheckBoxListSelectionModel
public CheckBoxListSelectionModel() -
CheckBoxListSelectionModel
-
-
Method Details
-
getAllEntryIndex
public int getAllEntryIndex()Gets the index of the "all" entry in the CheckBoxList.- Returns:
- the index of the "all" entry. -1 if no "all" entry exists.
- Since:
- 3.3.5
- See Also:
-
setAllEntryIndex
public void setAllEntryIndex(int allEntryIndex) Sets the index of the "all" entry in the CheckBoxList. If the CheckBoxList has an "all" entry, check that entry on/off will check/uncheck all other entries. Uncheck any other entry will uncheck the "all" entry.- Parameters:
allEntryIndex- the index of the "all" entry.
-
getModel
-
setModel
-
intervalAdded
- Specified by:
intervalAddedin interfaceListDataListener
-
intervalRemoved
- Specified by:
intervalRemovedin interfaceListDataListener
-
contentsChanged
- Specified by:
contentsChangedin interfaceListDataListener
-
updateAllEntryIf
protected void updateAllEntryIf() -
insertIndexInterval
public void insertIndexInterval(int index, int length, boolean before) Overrides so that inserting a row will not be selected automatically if the row after it is selected.- Specified by:
insertIndexIntervalin interfaceListSelectionModel- Overrides:
insertIndexIntervalin classDefaultListSelectionModel- Parameters:
index- the index where the rows will be inserted.length- the number of the rows that will be inserted.before- it's before or after the index.
-
isAllEntryConsidered
public boolean isAllEntryConsidered()Gets the flag indicating if this CheckBoxListSelectionModel should consider the CheckBoxList.ALL item if there is one.- Returns:
- true if need check. Otherwise false.
- Since:
- 3.3.3
- See Also:
-
setAllEntryConsidered
public void setAllEntryConsidered(boolean allEntryConsidered) Sets the flag indicating if this CheckBoxListSelectionModel should consider the CheckBoxList.ALL item if there is one. By default, the flag is true. If you want to improve the performance and don't have "all" entry, or if you do have an entry similar to "all" entry but want to treat it as a normal entry, please set it to false.- Parameters:
allEntryConsidered- the flag- Since:
- 3.3.3
-
isSelectedIndex
public boolean isSelectedIndex(int index) - Specified by:
isSelectedIndexin interfaceListSelectionModel- Overrides:
isSelectedIndexin classDefaultListSelectionModel
-
setSelectionInterval
public void setSelectionInterval(int index0, int index1) - Specified by:
setSelectionIntervalin interfaceListSelectionModel- Overrides:
setSelectionIntervalin classDefaultListSelectionModel
-
getMinSelectionIndex
public int getMinSelectionIndex()- Specified by:
getMinSelectionIndexin interfaceListSelectionModel- Overrides:
getMinSelectionIndexin classDefaultListSelectionModel
-
addSelectionInterval
public void addSelectionInterval(int index0, int index1) - Specified by:
addSelectionIntervalin interfaceListSelectionModel- Overrides:
addSelectionIntervalin classDefaultListSelectionModel
-
removeSelectionInterval
public void removeSelectionInterval(int index0, int index1) - Specified by:
removeSelectionIntervalin interfaceListSelectionModel- Overrides:
removeSelectionIntervalin classDefaultListSelectionModel
-