12

I've managed to add an item to the popup menu when the user right-clicks on a file in the Project Explorer by adding something like this:

  <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions">
         <command
               commandId="commands.mycmd"
               label="do foo"
               style="push">
         </command>
      </menuContribution>
   </extension>

Now, the only reason I knew to use org.eclipse.ui.navigator.ProjectExplorer is because that is what everyone else seems to be doing (there is no record of this in Eclipse PDE documentation). The problem is that I want the same functionality in the Navigator and the Package Explorer views as well (right-click on a file and you can do "do foo" as in the Project Explorer. How do I find the locationURI of these other two views (Package Explorer and Navigator)?

I've tried the alt+shift+F2 tip to find such information but Eclipse does not allow you to get the information of the tab itself when you activate this mode.

4

1 回答 1

-4

利用

locationURI="popup:org.eclipse.ui.navigator.any?after=additions">

它会成功的。

于 2014-06-11T11:37:37.183 回答