final Matcher<? extends Widget> matcher = withMnemonic(menuName);
MenuItem menuItem = syncExec(new WidgetResult<MenuItem>() {
public MenuItem run() {
Menu bar = widget.getMenu();
Matcher<MenuItem> withMnemonic = withMnemonic(menuName);
List<MenuItem> menus = new MenuFinder().findMenus(bar, withMnemonic, true);
if (!menus.isEmpty())
return menus.get(0);
return null;
}
});