1
votes

i am new to eclipse plugin development. i created a plugin which creates the actionsets (toolbar menu). Onclick of it, calls the class file and perform some action. Here is my plugin.xml code:

<extension
     point="org.eclipse.ui.actionSets">
  <actionSet
        label="Action Set"
        visible="true"
        id="com.sample.actionSet">
     <menu
           label="Example &amp;Menu"
           id="exampleMenu">
        <separator
              name="exampleGroup">
        </separator>
     </menu>
     <action
           label="Run"
           icon="icons/sample.gif"
           class="com.sample.actions.Action"
           tooltip="Build APK"
           menubarPath="exampleMenu/exampleGroup"
           toolbarPath="exampleGroup"
           id="com.sample.actions.Run">
     </action>
</extension>

I tried of adding the toolbar menu with drop-down item for this action but none worked. How could i add an drop-down menu to the given action labelled "Run".

For More Imformation, it looks like:

http://help.eclipse.org/luna/topic/org.eclipse.jdt.doc.user/gettingStarted/images/run_dropdown.png

1
Your menu id is 'exampleMenuMenu' not 'exampleMenu' that you use in the 'menubarPath' - greg-449
I edited the code to "exampleMenu" now. - Ravi Kumar
Kindly let me know if my question contains any ambiguity.. - Ravi Kumar

1 Answers

0
votes

When you create a new plug-in project, the wizard asks if you would like to create it with some demo content.

There are quite a nice selection of samples there, and one of them is Plug-in with a popup menu. It is a working minimal demo, you could check it.