public static List < TreePath > computeExpandedPaths ( JTree tree ) { List < TreePath > treePaths = new ArrayList < TreePath > ( ) ; int rows = tree . getRowCount ( ) ; for ( int i = 0 ; i < rows ; i ++ ) { TreePath treePath = tree . getPathForRow ( i ) ; treePaths . add ( treePath ) ; } return treePaths ; }
Compute the list of all tree paths in the given tree that are currently expanded