Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:47 Go to next message
Jie Xiao is currently offline Jie XiaoFriend
Messages: 11
Registered: July 2009
Junior Member
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 16:21 Go to previous messageGo to next message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
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] Wed, 04 November 2009 00:08 Go to previous messageGo to next message
Jay Norwood is currently offline Jay NorwoodFriend
Messages: 155
Registered: July 2009
Senior Member
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 09:05 Go to previous message
Jie Xiao is currently offline Jie XiaoFriend
Messages: 11
Registered: July 2009
Junior Member
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: Thu Apr 25 15:37:35 GMT 2024

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

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

Back to the top