0

I'm developing an Eclipse RCP 4 application targeted to several platforms including OS X.

When testing the application within the Eclipse development environment under OS X, application menu integration works correctly. Preferences and About can be selected from the drop-down menu with the bold application name. About, Preferences and Exit are correctly automatically omitted from the drop-down File menu, which is where they should appear under Windows or Linux but not OS X.

When the application has been deployed using the Eclipse Delta Pack to OS X, the drop-down menu with the bold application name shows About and Preferences entries, but they do nothing when selected. About, Preferences and Exit display on the drop-down File menu, which is the expected behaviour only if the application is deployed to Windows or Linux, not on OS X.

Any suggestions for how to get the correct menu behaviour outside of Eclipse under OS X?

Here's the contents of the Application.e4xmi file, in which the menus are defined:

<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_1_XycKbsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ide.application" bindingContexts="_1_XyeabsEeSFCpZI3OEurw">
  <children xsi:type="basic:TrimmedWindow" xmi:id="_8rfnILaNEeSTFNGxwQXIhw" elementId="relui.trimmedwindow.rel" label="Rel" iconURI="platform:/plugin/RelUI/icons/RelAppIcon/32x32.png">
    <children xsi:type="advanced:PerspectiveStack" xmi:id="_BV6u4LaOEeSTFNGxwQXIhw" elementId="relui.perspectivestack.0">
      <children xsi:type="advanced:Perspective" xmi:id="_CGugwLaOEeSTFNGxwQXIhw" elementId="relui.perspective.0">
        <children xsi:type="basic:Part" xmi:id="_Gcb8wLaOEeSTFNGxwQXIhw" elementId="relui.part.0" contributionURI="bundleclass://RelUI/org.reldb.relui.parts.Main"/>
      </children>
    </children>
    <mainMenu xmi:id="_36hGILqYEeSSsbhT1QHqRQ" elementId="relui.menu.0">
      <children xsi:type="menu:Menu" xmi:id="_JS68YLqZEeSSsbhT1QHqRQ" elementId="relui.menu.file" label="File" tooltip="" mnemonics="F">
        <children xsi:type="menu:HandledMenuItem" xmi:id="_XU6QcLqZEeSSsbhT1QHqRQ" elementId="relui.handledmenuitem.newDatabase" label="New database" iconURI="platform:/plugin/RelUI/icons/NewDBIcon.png" mnemonics="M1+n" command="_eqs_ALqpEeSSsbhT1QHqRQ"/>
        <children xsi:type="menu:HandledMenuItem" xmi:id="_YysdELqZEeSSsbhT1QHqRQ" elementId="relui.handledmenuitem.openLocalDatabase" label="Open local database" iconURI="platform:/plugin/RelUI/icons/OpenDBLocalIcon.png" mnemonics="M1+l" command="_hYmvsLqpEeSSsbhT1QHqRQ"/>
        <children xsi:type="menu:HandledMenuItem" xmi:id="_aF044LqZEeSSsbhT1QHqRQ" elementId="relui.handledmenuitem.openRemoteDatabase" label="Open remote database" iconURI="platform:/plugin/RelUI/icons/OpenDBRemoteIcon.png" mnemonics="M1+r" command="_mkgz4LqpEeSSsbhT1QHqRQ"/>
        <children xsi:type="menu:MenuSeparator" xmi:id="_4_VjsLqZEeSSsbhT1QHqRQ" elementId="relui.menuseparator.0"/>
        <children xsi:type="menu:HandledMenuItem" xmi:id="_-x_hUMfrEeSqd4GfyFqaAQ" elementId="relui.handledmenuitem.about" label="About" command="_1_YZiqbsEeSFCpZI3OEurw"/>
        <children xsi:type="menu:HandledMenuItem" xmi:id="_58XzsLqZEeSSsbhT1QHqRQ" elementId="relui.handledmenuitem.exit" label="Exit" mnemonics="M1+x" command="_1_YZgKbsEeSFCpZI3OEurw"/>
      </children>
      <children xsi:type="menu:Menu" xmi:id="_V4OQALqZEeSSsbhT1QHqRQ" elementId="relui.menu.tools" label="Tools">
        <children xsi:type="menu:HandledMenuItem" xmi:id="_giqZcLqZEeSSsbhT1QHqRQ" elementId="relui.handledmenuitem.options" label="Preferences" iconURI="platform:/plugin/RelUI/icons/settingsIcon.png" mnemonics="M1+p" command="_85hu4No2EeSw-PA_k-Gusw"/>
        <children xsi:type="menu:HandledMenuItem" xmi:id="_68AVkNiyEeSgZfqMAYQ1XA" elementId="relui.handledmenuitem.viewLog" label="View log" tooltip="View system log" command="_sr9-cNiyEeSgZfqMAYQ1XA"/>
      </children>
    </mainMenu>
  </children>
  <handlers xmi:id="_1_YZgabsEeSFCpZI3OEurw" elementId="RelUI.handler.quitCommand" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.Quit" command="_1_YZgKbsEeSFCpZI3OEurw"/>
  <handlers xmi:id="_1_YZi6bsEeSFCpZI3OEurw" elementId="RelUI.handler.aboutCommand" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.About" command="_1_YZiqbsEeSFCpZI3OEurw"/>
  <handlers xmi:id="_Up7doLqpEeSSsbhT1QHqRQ" elementId="relui.handler.newdatabaseCommand" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.NewDatabase" command="_eqs_ALqpEeSSsbhT1QHqRQ"/>
  <handlers xmi:id="_vSU4kLqpEeSSsbhT1QHqRQ" elementId="relui.handler.openlocaldatabaseCommand" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.OpenLocalDatabase" command="_hYmvsLqpEeSSsbhT1QHqRQ"/>
  <handlers xmi:id="_4xZbELqpEeSSsbhT1QHqRQ" elementId="relui.handler.openremotedatabaseCommand" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.OpenRemoteDatabase" command="_mkgz4LqpEeSSsbhT1QHqRQ"/>
  <handlers xmi:id="_G4n_ALqrEeSSsbhT1QHqRQ" elementId="relui.handler.0" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.Options"/>
  <handlers xmi:id="_ziLoUNiyEeSgZfqMAYQ1XA" elementId="relui.handler.1" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.ViewLog" command="_sr9-cNiyEeSgZfqMAYQ1XA"/>
  <handlers xmi:id="_CkUugNo3EeSw-PA_k-Gusw" elementId="relui.handler.preferences" contributionURI="bundleclass://RelUI/org.reldb.relui.handlers.OpenPreferences" command="_85hu4No2EeSw-PA_k-Gusw"/>
  <bindingTables xmi:id="_1_YZgqbsEeSFCpZI3OEurw" bindingContext="_1_XyeabsEeSFCpZI3OEurw">
    <bindings xmi:id="_1_YZg6bsEeSFCpZI3OEurw" keySequence="M1+Q" command="_1_YZgKbsEeSFCpZI3OEurw"/>
    <bindings xmi:id="_1_YZhqbsEeSFCpZI3OEurw" keySequence="M1+O" command="_hYmvsLqpEeSSsbhT1QHqRQ"/>
  </bindingTables>
  <rootContext xmi:id="_1_XyeabsEeSFCpZI3OEurw" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
    <children xmi:id="_1_XyeqbsEeSFCpZI3OEurw" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
    <children xmi:id="_1_Xye6bsEeSFCpZI3OEurw" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
  </rootContext>
  <descriptors xmi:id="_mK_5oK1hEeSOtbblMyKyoQ" elementId="relui.partdescriptor.partdescriptor" label="PartDescriptor" tooltip="this is a tooltip" allowMultiple="true" closeable="true" dirtyable="true">
    <toolbar xmi:id="_n82RwK1hEeSOtbblMyKyoQ" elementId="relui.toolbar.0"/>
  </descriptors>
  <descriptors xmi:id="_rH1nEK1hEeSOtbblMyKyoQ" elementId="relui.partdescriptor.anotherPartDescriptor" label="Another part descriptor" tooltip="this is another part descriptor" allowMultiple="true" closeable="true" dirtyable="true">
    <toolbar xmi:id="_tOvCIK1hEeSOtbblMyKyoQ" elementId="relui.toolbar.1"/>
  </descriptors>
  <commands xmi:id="_1_YZgKbsEeSFCpZI3OEurw" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/>
  <commands xmi:id="_1_YZiqbsEeSFCpZI3OEurw" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
  <commands xmi:id="_eqs_ALqpEeSSsbhT1QHqRQ" elementId="relui.command.newdatabase" commandName="newdatabaseCommand" description="New database"/>
  <commands xmi:id="_hYmvsLqpEeSSsbhT1QHqRQ" elementId="relui.command.openLocalDatabase" commandName="openlocaldatabaseCommand" description="Open local database"/>
  <commands xmi:id="_mkgz4LqpEeSSsbhT1QHqRQ" elementId="relui.command.openremotedatabase" commandName="openremotedatabaseCommand" description="Open remote database"/>
  <commands xmi:id="_sr9-cNiyEeSgZfqMAYQ1XA" elementId="relui.command.viewlogcommand" commandName="viewLogCommand" description="View system log"/>
  <commands xmi:id="_85hu4No2EeSw-PA_k-Gusw" elementId="org.eclipse.ui.window.preferences" commandName="preferencesCommand" description="Preferences"/>
  <addons xmi:id="_1_XycqbsEeSFCpZI3OEurw" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
  <addons xmi:id="_1_Xyc6bsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
  <addons xmi:id="_1_XydKbsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
  <addons xmi:id="_1_XydabsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
  <addons xmi:id="_1_XydqbsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
  <addons xmi:id="_1_Xyd6bsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
  <addons xmi:id="_1_XyeKbsEeSFCpZI3OEurw" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
</application:Application>
greg-449
  • 109,219
  • 232
  • 102
  • 145
Dave
  • 1
  • 1
  • 2
  • I think you need to show us the code where you are setting up these menu items. – greg-449 Apr 09 '15 at 15:38
  • I've included the Application.e4xmi contents. – Dave Apr 09 '15 at 16:25
  • This looks OK. How are you building this for OS X? – greg-449 Apr 09 '15 at 16:28
  • Also try starting the app with the -clearPersistedState option to clear any old state that might be confusing things (or delete the workbench.xmi file in the workspace .metadata/.plugins/org.eclipse.e4.workbench directory) – greg-449 Apr 09 '15 at 16:53
  • I'm building for OS X by installing the Eclipse Delta Pack 4.4 into Eclipse, creating a Product.product file, and using the "Eclipse Product export wizard". – Dave Apr 09 '15 at 17:32
  • I tried -clearPersistedState and deleted workspace/.metadata. No change. I'm running under OS X 10.10.3, if that makes a difference. 10.10.2 had the same problem. – Dave Apr 09 '15 at 17:33
  • The actual redirection is done by CocoaUIHandler in org.eclipse.ui.workbench.renderers.swt.cocoa. So check your Mac build is for cocoa (I use cocoa 64 bit) and that the plugin is being included in the build. – greg-449 Apr 09 '15 at 18:21
  • That's it! Thanks! org.eclipse.e4.ui.workbench.renderers.swt.cocoa_0.11.200.v20140417-0906.jar is not being copied to the macosx.cocoa.x86_64 deployment, though it is being copied to the macosx.cocoa.x86 deployment. Now to find out why... – Dave Apr 09 '15 at 20:43

1 Answers1

0

The fragment .jar file org.eclipse.e4.ui.workbench.renderers.swt.cocoa_0.11.200.v20140417-0906.jar (found in the Eclipse target platform plugin directory) is not automatically copied to the macosx (Cocoa/X86_64) platform deployment by the .product "Eclipse Product export wizard".

It is automatically copied to the macosx (Cocoa/X86) platform deployment.

I've created a shell script to manually copy the file as required, pending discovery of a better solution.

Dave
  • 1
  • 1
  • 2
  • Did you find out the source of the problem or a better solution? – João Pereira Apr 09 '18 at 14:58
  • Looks like it was a bug in the Eclipse Delta Pack, which I no longer use. I currently use https://wiki.eclipse.org/Building and follow the instructions under "Preferred way of doing multi-platform builds". It works correctly. – Dave Apr 10 '18 at 15:40