Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Not able to access Context Menu for tree
Not able to access Context Menu for tree [message #537491] Wed, 02 June 2010 15:37
Rahman  is currently offline Rahman Friend
Messages: 8
Registered: December 2009
Junior Member
I am facing issue in selecting/clicking a menu item in the context menu for a tree. I Searched in google and found some code and tried. It is returning 50 values int he search.
But when I tried to see what menu item is that iam getting two errors 1. Disposed and 2. Wrong Thread.

some one help me to find the context menu items for a tree and how to know what items are there.


final org.hamcrest.Matcher<MenuItem> matcher = allOf(widgetOfType(MenuItem.class));
final ContextMenuFinder menuFinder = new ContextMenuFinder((Control) ddTree.widget );
bot.waitUntil(new DefaultCondition() {
public String getFailureMessage() {
return "Could not find context menu items";
}

public boolean test() throws Exception {
return !menuFinder.findMenus(matcher).isEmpty();
}
});

java.util.List<MenuItem> list = menuFinder.findMenus(matcher);
for(int i=0;i<list.size();i++){
System.out.println(i);
try{
System.out.println("***"+list.get(i).getText());
}catch(Exception e){
System.out.println(e.toString());
}
}


Thanks for your help in advance.

Thanks
Rahman
Previous Topic:Update problems
Next Topic:Accessing wizard error/warning messages?
Goto Forum:
  


Current Time: Thu Apr 25 11:18:13 GMT 2024

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

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

Back to the top