我正在开发针对包括OS X在内的多个平台的Eclipse RCP 4应用程序。
在OS X下的Eclipse开发环境中测试应用程序时,应用程序菜单集成可以正常工作。可以从带有粗体应用程序名称的下拉菜单中选择“首选项”和“关于”。关于,首选项和退出正确地从下拉文件菜单中自动省略,这是它们应出现在Windows或Linux下但不是OS X下的位置。
使用Eclipse Delta Pack将应用程序部署到OS X时,带有粗体应用程序名称的下拉菜单会显示“关于”和“首选项”条目,但在选中时它们不执行任何操作。关于,首选项和退出显示在下拉文件菜单上,这是仅当应用程序部署到Windows或Linux而不是OS X时的预期行为。
有关如何在OS X下在Eclipse之外获取正确菜单行为的任何建议吗?
这是Application.e4xmi文件的内容,其中定义了菜单:
<?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>
答案 0 :(得分:0)
片段.jar文件 org.eclipse.e4.ui.workbench.renderers.swt.cocoa_0.11.200.v20140417-0906.jar (在Eclipse目标平台插件目录中找到)不是通过.product“Eclipse Product export wizard”自动复制到macosx(Cocoa / X86_64)平台部署。
它会自动复制到macosx(Cocoa / X86)平台部署。
我已经创建了一个shell脚本来根据需要手动复制文件,等待发现更好的解决方案。