|
Re: Select Tree Items Problem [message #484824 is a reply to message #484807] |
Wed, 09 September 2009 13:03 |
Pascal G Messages: 157 Registered: July 2009 |
Senior Member |
|
|
Jie Xiao wrote:
> Hallo,
> In my RCP program, I use the desktop tree as the main folder to save the
> other created folders. These folders are created automatically in the
> SWTBot test cases before. But it seems that SWTBot can not select these
> folder, although I have expanded desktop tree.
> SWTBotTreeItem[] desktopItems = desktopTree.getAllItems();
> for(SWTBotTreeItem tempItem:desktopItems){
> String itemString=tempItem.getText();
> System.out.println("The items in desktop are "+ itemString);
> }
>
> I have checked the items of the tree. The output items are only "Desktop"??
> I guess, the tree is dynamically adding, not before defined. Or else?
>
the SWTBotTree#getAllItems() only returns the top-level items, and not
sub-items of those. For exemple, if you have:
foo
-foobar
bar
-barfoo
the method will only return foo and bar, and not the second level elements.
Seeing this, I got the idea that we might want an API to get all items
up to a certain depth, something like SWTBotTree#items(int depth) (and
change the naming of getAllItems() to items()). We could then define a
constant DEPTH_INFINITE that could be passed to the items(int) method
which would get all the items in the tree.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
|
Powered by
FUDForum. Page generated in 0.03281 seconds