Bug 205792 [Mac] Enhance org.eclipse.ui.carbon plugin in order to modify the system menus
Build ID: Eclipse 3.3 Steps To Reproduce: the org.eclipse.ui.carbon provides the About and Preferences menu items but it doesn;t handle the menu text of "Hide eclipse" and "Quit eclipse". It should modify the menu text as the corresponding product name as like as About menu More information: here has some sample code to modify the menu text in org.eclipse.ui.carbon private static final int kHICommandHide = ('h' << 24) + ('i' << 16) + ('d' << 8) + 'e'; int[] outHideMenu = new int[1]; short[] outHideIndex = new short[1]; if (OS.GetIndMenuItemWithCommandID(0, kHICommandHide, 1, outHideMenu, outHideIndex) == OS.noErr && outHideMenu[0] != 0) { int l = fHideActionName.length(); char buffer[] = new char[l]; fHideActionName.getChars(0, l, buffer, 0); int str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, l); OS.SetMenuItemTextWithCFString (outHideMenu[0], outHideIndex[0], str); OS.CFRelease(str); }
bundles/org.eclipse.ui.carbon/src/org/eclipse/ui/carbon/CarbonUIEnhancer.java
}
        
        int[] mask = new int[] { OS.kEventClassWindow, OS.kEventWindowToolbarSwitchMode };
        OS.InstallEventHandler(OS.GetApplicationEventTarget(), commandProc,
                mask.length / 2, mask, 0, null);
		
	}
	/**
     * See Apple Technical Q&A 1079 (http://developer.apple.com/qa/qa2001/qa1079.html)
     */
    private void hookApplicationMenu(Display display) {
        
        Object target = new Target();
        final Callback commandCallback = new Callback(target, "commandProc", 3); 
        int commandProc = commandCallback.getAddress();
        if (commandProc == 0) {
            commandCallback.dispose();
            return; 
        }
        
        int[] mask = new int[] { OS.kEventClassCommand, OS.kEventProcessCommand };
        OS.InstallEventHandler(OS.GetApplicationEventTarget(), commandProc,
                mask.length / 2, mask, 0, null);
        
        int[] outMenu = new int[1];
        short[] outIndex = new short[1];
        if (OS.GetIndMenuItemWithCommandID(0, kHICommandPreferences, 1, outMenu, outIndex) == OS.noErr
                && outMenu[0] != 0) {
            int menu = outMenu[0];
            int l = fAboutActionName.length();