Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Plugin Development : How to add option in Right Click Menu

I have created an eclipse plugin. I am able to add a menu and submenu.

However, I am not able to add an option in the Right Click menu. Does anyone have any idea how to do that?

like image 601
TheHat Avatar asked Jan 18 '11 16:01

TheHat


People also ask

How to add menu item in eclipse plugin?

menus extension point. Right-click on the extension point and select New menuContribution. Create a new menu contribution with the "menu:org. eclipse.


1 Answers

Here's an example (this code has filled with your preferences and classes and to be added to the plugin.xml):

<extension point="org.eclipse.ui.popupMenus"> 
    <objectContribution
      adaptable="true"
      id=""
      nameFilter=""
      objectClass="org.eclipse.core.resources.IFile">
      <action
         id="org.eclipse.ui.articles.action.contribution.object.action1" 
         label=""
         icon=""
         menubarPath="additions"
         class=""> 
      </action>
    </objectContribution>
</extension>
like image 141
leoberto Avatar answered Sep 23 '22 09:09

leoberto