title: invoking an action of popup menu in Eclipse Plugin
body: <p>In my current project, a developer writes high-level specifications in Domain specific language and then compiles this specification and generate code in target programming language such as Java and Android. The developer writes mainly there four specification (as shown in the image below) : <code>vocab.mydsl</code>, <code>arch.mydsl</code>, <code>interaction.mydsl</code>, and <code>deploy.mydsl</code>. </p>
  
  <p><a href="https://i.stack.imgur.com/kj4pr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kj4pr.png" alt="enter image description here"></a></p>
  
  <p>Now, to compile each specification file separately, I have developed <strong>a pop-up menu in Eclipse Plugin</strong>. For your reference, I am showing a pop-up menu for vocabulary specification. Here, the developer makes a right click, then he goes to <strong>IoTSuite</strong> pop-up menu, then further down to <strong>Compile Domain Spec</strong> pop-up menu.</p>
  
  <p><a href="https://i.stack.imgur.com/x7H6Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x7H6Y.png" alt="enter image description here"></a></p>
  
  <p>Here, the problem is all four pop-up menus are appearing when I right click on <code>vocab.mydsl</code>. Ideally, when I make a right-click on <code>vocab.mydsl</code>, it should <strong>only</strong> show <strong>compile domain spec</strong> pop-up menu. Similar way, when I make a right click on <code>arch.mydsl</code>, it should <strong>only</strong> show <strong>compile Architecture Spec</strong> pop up menu. This applies to other specifications to also. </p>
  
  <p>How should I enable this feature in the Eclipse Plugin? Please let me know in case you need more information to get clarity further.</p>
  
  <p>The content of plugin.xml as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?eclipse version="3.4"?&gt;
  &lt;plugin&gt;
  
     &lt;extension
           point="org.eclipse.ui.popupMenus"&gt;
        &lt;objectContribution
              objectClass="org.eclipse.core.resources.IFile"
              id="org.example.helloworld.contribution1"&gt;
           &lt;menu
                 label="IoTSuite"
                 path="additions"
                 id="org.example.helloworld.menu1"&gt;
              &lt;separator
                    name="group1"&gt;
              &lt;/separator&gt;
           &lt;/menu&gt;
           &lt;action
                 label="Compile Domain Spec"
                 class="org.example.helloworld.popup.actions.GenerateVocabularyFramework"
                 menubarPath="org.example.helloworld.menu1/group1"
                 enablesFor="1"
                 id="org.example.helloworld.newAction"&gt;
           &lt;/action&gt;
           &lt;action
                 class="org.example.helloworld.popup.actions.GenerateArchitectureFramework"
                 id="org.example.helloworld.action2"
                 label="Compile Architecture Spec"
                 menubarPath="org.example.helloworld.menu1/group1"&gt;
           &lt;/action&gt;
           &lt;action
                 class="org.example.helloworld.popup.actions.GenerateInteractionFramework"
                 id="org.example.helloworld.action3"
                 label="Compile User Interaction Spec"
                 menubarPath="org.example.helloworld.menu1/group1"&gt;
           &lt;/action&gt;
           &lt;action
                 class="org.example.helloworld.popup.actions.GenerateDeploymentFramework"
                 id="org.example.helloworld.action4"
                 label="Compile Deployment Spec"
                 menubarPath="org.example.helloworld.menu1/group1"&gt;
           &lt;/action&gt;
        &lt;/objectContribution&gt;
     &lt;/extension&gt;
  
  &lt;/plugin&gt;
  </code></pre>