Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Plugin - Popup Menu Extension

I am trying to add a new menu item to Eclipse's popupmenus. It really seemed straightforward enough in the examples and tutorials but the menu item itself is never visible. I expect this to work in all views and for basically anything that is a file. I am using Eclipse 3.4. This is the my plugin.xml configuration:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>

   <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="org.eclipse.core.resources.IFile"
            id="com.willcodejavaforfood.ExploreHere.contribution1">
         <action
               label="Explore Here"
               class="com.willcodejavaforfood.explorehere.popup.actions.ExploreHereAction"
               menubarPath="additions"
               enablesFor="1"
               id="com.willcodejavaforfood.ExploreHere.newAction">
         </action>
      </objectContribution>
   </extension>

</plugin>

Any idea why it is never visible?

----edit----

Turns out my plugin works just fine in version 3.4.2 of Ganymede, but not in the older version 3.4.0 that I previously used.

like image 473
willcodejavaforfood Avatar asked Jun 08 '26 12:06

willcodejavaforfood


1 Answers

May be you can try the PDE templates:

File -> New plugin project -> On the last page select create from template and try the Plugin with popup menu which description is exactly what you want:

"This template adds a submenu and a new action to a target object's popup menu. This contribution will appear in all viewers where an object of the specified type is selected."

Hope this can help

Manu

like image 64
Manuel Selva Avatar answered Jun 11 '26 03:06

Manuel Selva