Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » My plugin can't add to menu when right-clicking the editor
My plugin can't add to menu when right-clicking the editor [message #1786092] Wed, 25 April 2018 12:58
Kevin Söderberg is currently offline Kevin SöderbergFriend
Messages: 1
Registered: April 2018
Junior Member
I'm currently making a plugin for CDT where I want to add a menu item to the menu that pop up when you right-click the editor. So far I have been unable to hook into that specific part unless i use the URI=org.eclipse.ui.popup.any. But that gives me the problem that it adds it to every popup menu in eclipse.

General code for that part is:
<extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="popup:org.eclipse.ui.popup.any?before=additions">
         <menu
               label="Test Menu"
               mnemonic="U"
               tooltip="List of items">
            <command
                  commandId="testing.commands.runOne"
                  label="Run for One"
                  mnemonic="R"
                  style="push"
                  tooltip="Tooltip test 1">
            </command>
            <command
                  commandId="testing.commands.runTwo"
                  label="Run for Two"
                  mnemonic="G"
                  style="push"
                  tooltip="Tooltip test 2">
            </command>
            <command
                  commandId="testing.commands.runThree"
                  label="Run for Three"
                  mnemonic="E"
                  style="push"
                  tooltip="Tooltip test 3">
            </command>
         </menu>
      </menuContribution>
   </extension>


I've tried to use following locationURIs:
org.eclipse.cdt.ui.editor.CEditor
org.eclipse.cdt.ui.editor.CEditor.EditorContext
org.eclipse.cdt.ui.editor.CEditor.RulerContext
org.eclipse.cdt.ui.editor.CEditor#PopupMenu
org.eclipse.cdt.ui.editor.EditorContext#PopupMenu
org.eclipse.cdt.ui.editor.CEditor.RulerContext#PopupMenu

What locationURI is required to hook into that menu?

Best Regards,
Kevin
Previous Topic:Unresolved methods from included hpp file
Next Topic:Resolving preprocessor directive errors
Goto Forum:
  


Current Time: Sat Sep 22 22:18:02 GMT 2018

Powered by FUDForum. Page generated in 0.01628 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top