### Eclipse Workspace Patch 1.0 #P org.jboss.tools.vpe.browsersim Index: src/org/jboss/tools/vpe/browsersim/ui/CocoaUIEnhancer.java =================================================================== --- src/org/jboss/tools/vpe/browsersim/ui/CocoaUIEnhancer.java (revision 41634) +++ src/org/jboss/tools/vpe/browsersim/ui/CocoaUIEnhancer.java (working copy) @@ -53,6 +53,11 @@ public CocoaUIEnhancer( String appName ) { this.appName = appName; } + + public void initializeMacOSMenuBar(){ + System.setProperty("com.apple.mrj.application.apple.menu.about.name", appName);//$NON-NLS-1$ + + } /** * Hook the given Listener to the Mac OS X application Quit menu and the IActions to the About @@ -167,9 +172,8 @@ invoke( nsmenuCls, appMenu, "itemAtIndex", new Object[] { wrapPointer( kAboutMenuItem ) } ); /* yradtsevich: The following lines in the original source are - * replaced by the call of System.getProperty, which does the same job. + * replaced by the call of initializeMacOSMenuBar(), which does the same job. * See https://issues.jboss.org/browse/JBIDE-11048 */ - System.setProperty("com.apple.mrj.application.apple.menu.about.name", appName);//$NON-NLS-1$ // if ( appName != null ) { // Object nsStr = invoke( nsstringCls, "stringWith", new Object[] { "About " + appName } ); // invoke( nsmenuitemCls, aboutMenuItem, "setTitle", new Object[] { nsStr } ); Index: src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java =================================================================== --- src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java (revision 41634) +++ src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java (working copy) @@ -89,6 +89,12 @@ private ResizableSkinSizeAdvisor sizeAdvisor; public static void main(String[] args) { + //CocoaUIEnhancer - is a class released by EPL, which handles connection between the About, Preferences and Quit menus in MAC OS X + CocoaUIEnhancer cocoaUIEnhancer = null; + if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs())) { + cocoaUIEnhancer = new CocoaUIEnhancer(Messages.BrowserSim_BROWSER_SIM); + cocoaUIEnhancer.initializeMacOSMenuBar(); + } String homeUrl; if (args.length > 0) { String lastArg = args[args.length - 1]; @@ -118,8 +124,8 @@ // set event handlers for Mac OS X Menu-bar - if (PlatformUtil.OS_MACOSX.equals(PlatformUtil.getOs())) { - browserSim.addMacOsMenuApplicationHandler(); + if (cocoaUIEnhancer != null) { + browserSim.addMacOsMenuApplicationHandler(cocoaUIEnhancer); } @@ -785,8 +791,7 @@ } - private void addMacOsMenuApplicationHandler() { - CocoaUIEnhancer enhancer = new CocoaUIEnhancer(Messages.BrowserSim_BROWSER_SIM); + private void addMacOsMenuApplicationHandler(CocoaUIEnhancer enhancer) { Listener quitListener = new Listener() { @Override