VLostBoy
VLostBoy

Reputation: 4194

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 separator 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> 

Upvotes: 3

Views: 2726

Answers (1)

Prakash G. R.
Prakash G. R.

Reputation: 4892

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 ...

Upvotes: 3

Related Questions