开发者

Eclipse Plugin-ins: How can I add a group to the popup context menu?

I have a command available in the eclipse context menu when I right click on a project folder. THe submenu is visible in what I believe is the 'additions' section of the context menu. However, I want a line s开发者_StackOverflow社区eparator do distinguish my contribution from other additions. How can I do this? I know that with action contributions, you can use menuBarPath (I think) to create a group and add actions to it, but how can I do this using the menuContribution tag in plugin.xml?

<extension point="org.eclipse.ui.menus">
  <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
        <menu label="PopKit">
            <command
                commandId="convertToAppKitProjectCommand"
                mnemonic="S"
                id="ie.ondevice.popkit.plugin.menus.popup.convertProjectCommand">
                <visibleWhen>
                   <with variable="activeMenuSelection">
                      <iterate>
                         <adapt type="org.eclipse.core.resources.IProject"/>
                      </iterate>
                   </with>
                </visibleWhen>                  
            </command>
        </menu>
  </menuContribution> 


Add a separator to your menu in the contribution:

<menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
    <menu label="PopKit">
       <separator
             name="some.id.here.">
       </separator>
       <command
             commandId="convertToAppKitProjectCommand"

       // the rest ...
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜