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
return OS.eventNotHandledErr;
			
			int [] theWindow = new int [1];
			OS.GetEventParameter (theEvent, OS.kEventParamDirectObject, OS.typeWindowRef, null, 4, null, theWindow);
			
			int [] theRoot = new int [1];
			OS.GetRootControl (theWindow [0], theRoot);
			Widget widget = Display.getCurrent().findWidget(theRoot [0]);
			
			if (!(widget instanceof Shell)) {
				return OS.eventNotHandledErr;
			}
			Shell shell = (Shell) widget;
			IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
					.getWorkbenchWindows();
			for (int i = 0; i < windows.length; i++) {
				if (windows[i].getShell() == shell) {
					return runCommand("org.eclipse.ui.ToggleCoolbarAction"); 
				}
			}
			return OS.eventNotHandledErr;
		}
        public int commandProc(int nextHandler, int theEvent, int userData) {
            if (OS.GetEventKind(theEvent) == OS.kEventProcessCommand) {
                HICommand command = new HICommand();
                OS.GetEventParameter(theEvent, OS.kEventParamDirectObject,
                        OS.typeHICommand, null, HICommand.sizeof, null, command);
                switch (command.commandID) {
                case kHICommandPreferences:
                    return runAction("preferences");