Bug 270774 [Mac] ui.tests.rcp did not finish because CocoaUIEnhancer crashes
bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/CocoaUIEnhancer.java
}
		}
	}
	
    private void hookApplicationMenu() {
    	try {
    		
    		NSMenu mainMenu = NSApplication.sharedApplication().mainMenu();
    		NSMenuItem mainMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, mainMenu, "itemAtIndex", new Object[] {wrapPointer(0)});
    		NSMenu appMenu = mainMenuItem.submenu();
    		
    		NSMenuItem aboutMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, appMenu, "itemAtIndex", new Object[] {wrapPointer(kAboutMenuItem)});
    		aboutMenuItem.setTitle(NSString.stringWith(fAboutActionName));
    		
    		if (fHideActionName != null) {
    			NSMenuItem hideMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, appMenu, "itemAtIndex", new Object[] {wrapPointer(kHideApplicationMenuItem)});
    			hideMenuItem.setTitle(NSString.stringWith(fHideActionName));
    		}
    		
    		if (fQuitActionName != null) {
    			NSMenuItem quitMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, appMenu, "itemAtIndex", new Object[] {wrapPointer(kQuitMenuItem)});
    			quitMenuItem.setTitle(NSString.stringWith(fQuitActionName));
    		}
    		
    		NSMenuItem prefMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, appMenu, "itemAtIndex", new Object[] {wrapPointer(kPreferencesMenuItem)});
    		prefMenuItem.setEnabled(true);
    		
    		NSMenuItem servicesMenuItem = (NSMenuItem) invokeMethod(NSMenu.class, appMenu, "itemAtIndex", new Object[] {wrapPointer(kServicesMenuItem)});
    		servicesMenuItem.setEnabled(false);