public static String getPath ( Treenode item , boolean useLabels ) { StringBuilder sb = new StringBuilder ( ) ; boolean needsDelim = false ; while ( item != null ) { if ( needsDelim ) { sb . insert ( 0 , ' ' ) ; } else { needsDelim = true ; } sb . insert ( 0 , useLabels ? item . getLabel ( ) : item . getIndex ( ) ) ; item = ( Treenode ) item . getParent ( ) ; } return sb . toString ( ) ; }
Returns the path of the specified tree node . This consists of the indexes or labels of this and all parent nodes separated by a \ character .