Dienstag, 3. November 2009

SelectNestedTreeItem

This is bug of SWTBot.
(http://swtbot.org/bugzilla/show_bug.cgi?id=10)
The solution is:
tree.select(new String[]{"Node 2"});
tree.expandNode("Node 2").expandNode("Node 2.2").select("Node 2.2.1");

Get the selected item "Node 2.2":
SWTBotTreeItem nodeitem=tree.expandNode("Node 2").expandNode("Node 2.2").select();

select nested item:
swtBotTree.expandNode(node[0]).select(node[1]);
->only return the node[0]
swtBotTree.expandNode(node[0]).expandNode(node[1]).select();
->return the tree item node[1]

When there are more items with the same name in the level of node[2]:
swtBotTreeItem tmp=swtBotTree.expandNode(node[0]).expandNode(node[1]).expand().getNode(node[2],index);
then,select this swtBotTreeItem
tmp.select();

Keine Kommentare: