private void expandNode(final TreeNode node,final TreePath path,final int level){
  if (level <= 0) {
    return;
  }
  tree.expandPath(path);
  for (int i=0; i < node.getChildCount(); ++i) {
    final TreeNode childNode=node.getChildAt(i);
    expandNode(childNode,path.pathByAddingChild(childNode),level - 1);
  }
}

private void expandNode ( final TreeNode node , final TreePath path , final int level ) { if ( level <= 0 ) { return ; } tree . expandPath ( path ) ; for ( int i = 0 ; i < node . getChildCount ( ) ; ++ i ) { final TreeNode childNode = node . getChildAt ( i ) ; expandNode ( childNode , path . pathByAddingChild ( childNode ) , level - 1 ) ; } }
expand the given tree to the given level , starting from the given node and path .
