1

In Eclipse main menu how to contribute to an existing Main Menu for ex need to create a context menu under Main menu "File" . What is the location URI "File"

Big Bang Theory
  • 311
  • 1
  • 4
  • 16

2 Answers2

4

The location URI for the file menu is menu:file.

See org.eclipse.ui.internal.ide.WorkbenchActionBuilder for information about the different sections and IDs...

Tonny Madsen
  • 12,628
  • 4
  • 31
  • 70
0

Here is an example how to add submenu to File menu:

   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            id="com.my.plugin.actionSet"
            label="My ActionSet"
            visible="true">
         <menu
               id="mymenu"
               label="My Menu"
               path="file/fileEnd">
            <groupMarker
                  name="start">
            </groupMarker>
            <separator
                  name="additions">
            </separator>
         </menu>
         <action
               class="com.my.plugin.ActionClass"
               id="com.myplugin.action"
               label="Action"
               menubarPath="file/mymenu/start"
               style="push">
         </action>
      </actionSet>
   </extension>

Constants for positioning MyMenu within File menu could be found at org.eclipse.ui.IWorkbenchActionConstants

Cheers, Max

Max
  • 2,917
  • 1
  • 16
  • 16