public static Treenode findNodeByLabel ( Treeview tree , String label , boolean caseSensitive ) { for ( Treenode item : tree . getChildren ( Treenode . class ) ) { if ( caseSensitive ? label . equals ( item . getLabel ( ) ) : label . equalsIgnoreCase ( item . getLabel ( ) ) ) { return item ; } } return null ; }
Search the entire tree for a tree item matching the specified label .