Java Doc for CheckBoxTreeSelectionModel.java in  » Swing-Library » jide-common » com » jidesoft » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jide common » com.jidesoft.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.tree.DefaultTreeSelectionModel
      com.jidesoft.swing.CheckBoxTreeSelectionModel

CheckBoxTreeSelectionModel
public class CheckBoxTreeSelectionModel extends DefaultTreeSelectionModel (Code)
CheckBoxTreeSelectionModel is a selection _model based on DefaultTreeSelectionModel and use in CheckBoxTree to keep track of the checked tree paths.
author:
   Santhosh Kumar T



Constructor Summary
public  CheckBoxTreeSelectionModel(TreeModel model)
    
public  CheckBoxTreeSelectionModel(TreeModel model, boolean digIn)
    

Method Summary
public  voidaddSelectionPaths(TreePath[] paths)
     Overrides the method in DefaultTreeSelectionModel to consider digIn mode.
public  TreeModelgetModel()
    
public  booleanisDigIn()
     Gets the dig-in mode.
public  booleanisPartiallySelected(TreePath path)
     Tests whether there is any unselected node in the subtree of given path.
Parameters:
  path - check if the path is partially selected.
public  booleanisPathSelected(TreePath path, boolean digIn)
     Tells whether given path is selected.
public  booleanisSingleEventMode()
    
protected  voidnotifyPathChange(Vector changedPaths, TreePath oldLeadSelection)
    
protected  voidnotifyPathChange(TreePath[] changedPaths, boolean isNew, TreePath oldLeadSelection)
     Notifies listeners of a change in path.
public  voidremoveSelectionPaths(TreePath[] paths)
    
public  voidsetBatchMode(boolean batchMode)
    
public  voidsetDigIn(boolean digIn)
     Sets the dig-in mode.
public  voidsetModel(TreeModel model)
    
public  voidsetSelectionPaths(TreePath[] pPaths)
     Overrides the method in DefaultTreeSelectionModel to consider digIn mode.
public  voidsetSingleEventMode(boolean singleEventMode)
     Single event mode is a mode that always fires only one event when you select or unselect a tree node.

Taking this tree as an example,

 A -- a
   |- b
   |- c
 
Case 1: Assuming b and c are selected at this point, you click on a.
  • In non-single event mode, you will get select-A, deselect-b and deselect-c three events
  • In single event mode, you will only get select-a.

Case 2: Assuming none of the nodes are selected, you click on A.

 voidsetTree(CheckBoxTree tree)
    


Constructor Detail
CheckBoxTreeSelectionModel
public CheckBoxTreeSelectionModel(TreeModel model)(Code)



CheckBoxTreeSelectionModel
public CheckBoxTreeSelectionModel(TreeModel model, boolean digIn)(Code)




Method Detail
addSelectionPaths
public void addSelectionPaths(TreePath[] paths)(Code)
Overrides the method in DefaultTreeSelectionModel to consider digIn mode.
Parameters:
  paths - the tree paths to be added to selection paths.



getModel
public TreeModel getModel()(Code)



isDigIn
public boolean isDigIn()(Code)
Gets the dig-in mode. If the CheckBoxTree is in dig-in mode, checking the parent node will check all the children. Correspondingly, getSelectionPaths() will only return the parent tree path. If not in dig-in mode, each tree node can be checked or unchecked independently true or false.



isPartiallySelected
public boolean isPartiallySelected(TreePath path)(Code)
Tests whether there is any unselected node in the subtree of given path.
Parameters:
  path - check if the path is partially selected. true i fpartially. Otherwise false.



isPathSelected
public boolean isPathSelected(TreePath path, boolean digIn)(Code)
Tells whether given path is selected. if dig is true, then a path is assumed to be selected, if one of its ancestor is selected.
Parameters:
  path - check if the path is selected.
Parameters:
  digIn - whether we will check its descendants. true if the path is selected.



isSingleEventMode
public boolean isSingleEventMode()(Code)



notifyPathChange
protected void notifyPathChange(Vector changedPaths, TreePath oldLeadSelection)(Code)



notifyPathChange
protected void notifyPathChange(TreePath[] changedPaths, boolean isNew, TreePath oldLeadSelection)(Code)
Notifies listeners of a change in path. changePaths should contain instances of PathPlaceHolder.
Parameters:
  changedPaths - the paths that are changed.
Parameters:
  isNew - is it a new path.
Parameters:
  oldLeadSelection - the old selection.



removeSelectionPaths
public void removeSelectionPaths(TreePath[] paths)(Code)



setBatchMode
public void setBatchMode(boolean batchMode)(Code)



setDigIn
public void setDigIn(boolean digIn)(Code)
Sets the dig-in mode. If the CheckBoxTree is in dig-in mode, checking the parent node will check all the children. Correspondingly, getSelectionPaths() will only return the parent tree path. If not in dig-in mode, each tree node can be checked or unchecked independently
Parameters:
  digIn - true to enable dig-in mode. False to disable it.



setModel
public void setModel(TreeModel model)(Code)



setSelectionPaths
public void setSelectionPaths(TreePath[] pPaths)(Code)
Overrides the method in DefaultTreeSelectionModel to consider digIn mode.
Parameters:
  pPaths - the tree paths to be selected.



setSingleEventMode
public void setSingleEventMode(boolean singleEventMode)(Code)
Single event mode is a mode that always fires only one event when you select or unselect a tree node.

Taking this tree as an example,

 A -- a
   |- b
   |- c
 
Case 1: Assuming b and c are selected at this point, you click on a.
  • In non-single event mode, you will get select-A, deselect-b and deselect-c three events
  • In single event mode, you will only get select-a.

Case 2: Assuming none of the nodes are selected, you click on A. In this case, both modes result in the same behavior.

  • In non-single event mode, you will get only select-A event.
  • In single event mode, you will only get select-A too.
Case 3: Assuming b and c are selected and now you click on A.
  • In non-single event mode, you will get select-A event as well as deselect-b and deselect-c event.
  • In single event mode, you will only get select-A.
As you can see, single event mode will always fire the event on the nodes you select. However it doesn't reflect what really happened inside the selection model. So if you want to get a complete picture of the selection state inside selection model, you should use CheckBoxTreeSelectionModel.getSelectionPaths() to find out. In non-single event mode, the events reflect what happened inside the selection model. So you can get a complete picture of the exact state without asking the selection model. The downside is it will generate too many events. With this option, you can decide which mode you want to use that is the best for your case.

By default, singleEventMode is set to false to be compatible with the older versions that don't have this option.
Parameters:
  singleEventMode - true or false.




setTree
void setTree(CheckBoxTree tree)(Code)



Fields inherited from javax.swing.tree.DefaultTreeSelectionModel
final public static String SELECTION_MODE_PROPERTY(Code)(Java Doc)
protected SwingPropertyChangeSupport changeSupport(Code)(Java Doc)
protected int leadIndex(Code)(Java Doc)
protected TreePath leadPath(Code)(Java Doc)
protected int leadRow(Code)(Java Doc)
protected DefaultListSelectionModel listSelectionModel(Code)(Java Doc)
protected EventListenerList listenerList(Code)(Java Doc)
protected transient RowMapper rowMapper(Code)(Java Doc)
protected TreePath[] selection(Code)(Java Doc)
protected int selectionMode(Code)(Java Doc)

Methods inherited from javax.swing.tree.DefaultTreeSelectionModel
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void addSelectionPath(TreePath path)(Code)(Java Doc)
public void addSelectionPaths(TreePath[] paths)(Code)(Java Doc)
public void addTreeSelectionListener(TreeSelectionListener x)(Code)(Java Doc)
protected boolean arePathsContiguous(TreePath[] paths)(Code)(Java Doc)
protected boolean canPathsBeAdded(TreePath[] paths)(Code)(Java Doc)
protected boolean canPathsBeRemoved(TreePath[] paths)(Code)(Java Doc)
public void clearSelection()(Code)(Java Doc)
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
protected void fireValueChanged(TreeSelectionEvent e)(Code)(Java Doc)
public TreePath getLeadSelectionPath()(Code)(Java Doc)
public int getLeadSelectionRow()(Code)(Java Doc)
public T[] getListeners(Class<T> listenerType)(Code)(Java Doc)
public int getMaxSelectionRow()(Code)(Java Doc)
public int getMinSelectionRow()(Code)(Java Doc)
public PropertyChangeListener[] getPropertyChangeListeners()(Code)(Java Doc)
public RowMapper getRowMapper()(Code)(Java Doc)
public int getSelectionCount()(Code)(Java Doc)
public int getSelectionMode()(Code)(Java Doc)
public TreePath getSelectionPath()(Code)(Java Doc)
public TreePath[] getSelectionPaths()(Code)(Java Doc)
public int[] getSelectionRows()(Code)(Java Doc)
public TreeSelectionListener[] getTreeSelectionListeners()(Code)(Java Doc)
protected void insureRowContinuity()(Code)(Java Doc)
protected void insureUniqueness()(Code)(Java Doc)
public boolean isPathSelected(TreePath path)(Code)(Java Doc)
public boolean isRowSelected(int row)(Code)(Java Doc)
public boolean isSelectionEmpty()(Code)(Java Doc)
protected void notifyPathChange(Vector<PathPlaceHolder> changedPaths, TreePath oldLeadSelection)(Code)(Java Doc)
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void removeSelectionPath(TreePath path)(Code)(Java Doc)
public void removeSelectionPaths(TreePath[] paths)(Code)(Java Doc)
public void removeTreeSelectionListener(TreeSelectionListener x)(Code)(Java Doc)
public void resetRowSelection()(Code)(Java Doc)
public void setRowMapper(RowMapper newMapper)(Code)(Java Doc)
public void setSelectionMode(int mode)(Code)(Java Doc)
public void setSelectionPath(TreePath path)(Code)(Java Doc)
public void setSelectionPaths(TreePath[] pPaths)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected void updateLeadIndex()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.