Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » No getParent or getParentItem
No getParent or getParentItem [message #479682] Wed, 12 August 2009 00:06
Jay Norwood is currently offline Jay NorwoodFriend
Messages: 154
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");


Here's some code to add to SWTBotTreeItem to implement it.

* Gets the widgets parentItem TreeItem or throws exception for null
* @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());
Previous Topic:failed chaining of select(String)
Next Topic:[swtbot4gef] Why is the constructor of SWTBotEditPart and SwtBotConnectionEditPart package-private?
Goto Forum:

Current Time: Sat May 26 00:48:05 GMT 2018

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

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

Back to the top