开发者

Wrong menu structure in an Eclipse RCP application

开发者 https://www.devze.com 2023-03-11 20:54 出处:网络
In plugin.xml for my application, I have <extension point=\"org.eclipse.ui.menus\"> <menuContribution

In plugin.xml for my application, I have

<extension
     point="org.eclipse.ui.menus">
  <menuContribution
        allPopups="false"
        locationURI="menu:org.eclipse.ui.main.menu">
     <menu
           id="ru.focusmedia.odp.arm.menus.arm"
           label="ARM"
           mnemonic="A">
   开发者_高级运维     <command
              commandId="org.eclipse.ui.file.exit"
              style="push">
        </command>
     </menu>
     <menu
           id="ru.focusmedia.odp.arm.menus.arm"
           label="Help"
           mnemonic="H">
        <command
              commandId="org.eclipse.ui.help.aboutAction"
              style="push">
        </command>
     </menu>
  </menuContribution>
</extension>

and expect it to create two menus in the main menubar, each with one item. However, I get only one menu (ARM) which contains both items (and no Help menu at all). Why? And how do I get the desired result?


Got the answer at http://www.eclipse.org/forums/index.php?t=rview&goto=681772#msg_681772: the problem is that two menus have the same id.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号