Using abbot.swt-0.1.0.20080305_1254 the following code works fine on Windows (It opens the File->New->Project dialog):
---------------
public void testOpeningMenu() {
final String MENU_PATH = "&File/&New/P&roject...";
final WidgetFinder finder = WidgetFinderImpl.getDefault();
final IWorkbench iw = PlatformUI.getWorkbench();
final Display d = iw.getDisplay();
final Menu rootMenu = Display.getDefault().getActiveShell().getMenuBar();
System.out.println("Menu: " + rootMenu + ":" + rootMenu.getItems()[0].getMenu());
Thread t = new Thread(new Runnable() {
public void run() {
MenuTester menuTester = MenuTester.getMenuTester();
System.out.println("Clicking " + MENU_PATH + ":" + rootMenu);
menuTester.actionClickItem(rootMenu, MENU_PATH);
}
});
t.start();
}
Unfortunately the code does not work on RHEL Linux. Actually I have tried pretty much everything Abbot and eclipse offers to open items in the menu, everything works on Windows, nothing works on Linux.
If someone disagrees with the code above, please post a piece of code that opens the mentioned dialog on Linux and I'll be more than happy :)
I am also receiving the same problem in Red Hat Linux 5.0