org.tbee.swing.tree
Class CheckTreeSelectionModel
java.lang.Object
javax.swing.tree.DefaultTreeSelectionModel
org.tbee.swing.tree.CheckTreeSelectionModel
- All Implemented Interfaces:
- Serializable, Cloneable, TreeSelectionModel
public class CheckTreeSelectionModel
- extends DefaultTreeSelectionModel
JTree should have two selections: one is normal selection and another is checkSelection (checkbox selected)
Why don't we use TreeSelectionModel to maintain checkSelection. But we can't use DefaultTreeSelection as-it-is without any changes. because we have to restrict the selection as explained in the above points:
In our check selection model, it contains only the selected node but not all its descendants. i.e. let us say Node A has children B, C, D;
When user checks Node A, the tree shows B, C and D also checked. But the selectionModel actually contains only A,
- Version:
- $Revision: 1.4 $
- See Also:
- Serialized Form
| Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel |
addPropertyChangeListener, addSelectionPath, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex |
SOURCECODE_VERSION
public static final String SOURCECODE_VERSION
- Standard variable for determining version of a class file.
- See Also:
- Constant Field Values
CheckTreeSelectionModel
public CheckTreeSelectionModel(TreeModel model)
isPartiallySelected
public boolean isPartiallySelected(TreePath path)
isPathSelected
public boolean isPathSelected(TreePath path,
boolean dig)
setSelectionPaths
public void setSelectionPaths(TreePath[] pPaths)
- Specified by:
setSelectionPaths in interface TreeSelectionModel- Overrides:
setSelectionPaths in class DefaultTreeSelectionModel
addSelectionPaths
public void addSelectionPaths(TreePath[] paths)
- Specified by:
addSelectionPaths in interface TreeSelectionModel- Overrides:
addSelectionPaths in class DefaultTreeSelectionModel
removeSelectionPaths
public void removeSelectionPaths(TreePath[] paths)
- Specified by:
removeSelectionPaths in interface TreeSelectionModel- Overrides:
removeSelectionPaths in class DefaultTreeSelectionModel
Copyright © 2012 KnowledgePlaza. All Rights Reserved.