No getParent or getParentItem [message #479682] |
Wed, 12 August 2009 00:06 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
Seems like it would be easier to move around in tree chains with
getParentItem and getParent.
tbot.getTreeItem("C1").expandNode("Debug").getParentItem().expandNode( "src");
tbot.getTreeItem("C1").expandNode("Debug").getParent().select( "C1");
tbot.getTreeItem("C1").expandNode("Debug").getParentItem().select();
-----------
Here's some code to add to SWTBotTreeItem to implement it.
/**
* Gets the widgets parentItem TreeItem or throws exception for null
parentItem.
*
* @return the parentItem of the current TreeItem
*/
public SWTBotTreeItem getParentItem() {
return syncExec(new Result<SWTBotTreeItem>() {
public SWTBotTreeItem run() {
return new SWTBotTreeItem(widget.getParentItem());
}
});
}
/**
* Gets the widgets parent Tree or throws exception for null parentItem.
*
* @return the parent Tree of the current TreeItem
*/
public SWTBotTree getParent() {
return syncExec(new Result<SWTBotTree>() {
public SWTBotTree run() {
return new SWTBotTree(widget.getParent());
}
});
}
|
|
|
Powered by
FUDForum. Page generated in 0.01973 seconds