Not able to access Context Menu for tree [message #537491] |
Wed, 02 June 2010 15:37 |
Rahman 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
|
|
|
Powered by
FUDForum. Page generated in 0.02665 seconds