Skip to main content



      Home
Home » Eclipse Projects » SWTBot » Get the TreeItem after selecting the nested TreeItem
Get the TreeItem after selecting the nested TreeItem [message #495039] Tue, 03 November 2009 10:47 Go to next message
Eclipse UserFriend
Hallo,
After selecting the nested TreeItem,
e.g:
tree = bot.treeWithLabel("Tree");
tree.select("Tree");
SWTBoTreeItem treeItem=tree.expandNode("Tree").select("Node1");

But the result of SWTTreeItem is "Tree" not "Node1".
Is there anything wrong? Thanks.
Re: Get the TreeItem after selecting the nested TreeItem [message #495051 is a reply to message #495039] Tue, 03 November 2009 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Jie Xiao wrote:
> Hallo,
> After selecting the nested TreeItem, e.g:
> tree = bot.treeWithLabel("Tree");
> tree.select("Tree");
> SWTBoTreeItem treeItem=tree.expandNode("Tree").select("Node1");
>
> But the result of SWTTreeItem is "Tree" not "Node1".
> Is there anything wrong? Thanks.
>
From the javadoc of SWTBotTreeItem#selection(String):
@return the current node.

thus it doesn't return the selected node.

--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Re: Get the TreeItem after selecting the nested TreeItem [message #495164 is a reply to message #495039] Tue, 03 November 2009 19:08 Go to previous messageGo to next message
Eclipse UserFriend
Maybe this does what you want.

SWTBotTreeItem treeItem=tree.expandNode("Tree").getTreeItem("Node1").select();
Re: Get the TreeItem after selecting the nested TreeItem [message #495810 is a reply to message #495039] Fri, 06 November 2009 04:05 Go to previous message
Eclipse UserFriend
Thanks for your two answers. I get the solution.
when I want to get the node "Node1", use:
tree.expandNode("Tree").expandNode("Node1").select();
Previous Topic:WorkbenchTestable : No classLoader
Next Topic:[Fwd: [Bug 269609] GEF editors support]
Goto Forum:
  


Current Time: Wed Jun 18 14:51:31 EDT 2025

Powered by FUDForum. Page generated in 0.24671 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top