user3265703
user3265703

Reputation: 75

Eclipse RCP - Add submenu to existing file menu

I want to add submenu to existing file menu. I tried below:

<extension
         point="org.eclipse.ui.menus">
       <menuContribution
            allPopups="false"
            locationURI="menu:org.eclipse.ui.file?after=additions ">
         <command
               commandId="com.my.home.handler.MyHandler"
               id="myTrams"
               label="TRAMS"
               style="push">
         </command>
      </menuContribution>
   </extension>

Can someone help to add submenu to existing file menu using plugin.xml? Thanks in advance.

Upvotes: 2

Views: 1889

Answers (2)

Chandrayya G K
Chandrayya G K

Reputation: 8849

Correct you locationURI as locationURI="menu:file?after=additions".

Upvotes: 0

greg-449
greg-449

Reputation: 111142

The menu id for the File menu is just file not 'org.eclipse.ui.file'

For example this is the menu contribution for 'File > Restart':

<menuContribution
        locationURI="menu:file?after=open.ext">
     <command
           commandId="org.eclipse.ui.file.restartWorkbench"
           id="org.eclipse.ui.file.restartWorkbench"
           style="push">
     </command>
</menuContribution>

Upvotes: 3

Related Questions