*/
public static SWTBotTreeItem selectEntry( final SWTWorkbenchBot bot, final SWTBotTree tree,
final boolean expandChild, final String... path )
{
List<String> pathList = new ArrayList<String>( Arrays.asList( path ) );
SWTBotTreeItem entry = null;
while ( !pathList.isEmpty() )
{
String currentPath = pathList.remove( 0 );
if ( entry == null )
{
currentPath = adjustNodeName( tree, currentPath );
entry = tree.getTreeItem( currentPath );
}
else
{
// adjust current path, because the label is decorated with the
// number of children
currentPath = adjustNodeName( entry, currentPath );
entry = entry.getNode( currentPath );
}
entry.click();
if ( !pathList.isEmpty() || expandChild )
{
// expand entry and wait till
// - children are displayed
// - next child is visible
final String nextName = !pathList.isEmpty() ? pathList.get( 0 ) : null;
expandEntry( bot, entry, nextName );
}
entry.select();
}
return entry;
}