title: Eclipse RCP: how to create a popup menu for the selection in a text editor?
body: <p>Using the Eclipse template I generated this sample which works fine when I select a file in the project explorer. However I want to also make it available when I do right-click on a Text Editor or even when I have some text selected.</p>
  
  <p>What is the right <strong>objectClass</strong> to use in the <strong>objectContribution</strong>?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;extension point="org.eclipse.ui.popupMenus"&gt;
    &lt;objectContribution
                        id="com.example.popup-cli.contribution1"
                        objectClass="org.eclipse.core.resources.IFile"&gt;
      &lt;menu
            id="com.example.popup.menu1"
            label="New Submenu"
            path="additions"&gt;
        &lt;separator
                   name="group1"&gt;
        &lt;/separator&gt;
      &lt;/menu&gt;
      &lt;action
              class="com.example.popup.actions.NewAction"
              enablesFor="1"
              id="com.example.popup.newAction"
              label="New Action"
              menubarPath="com.example.popup.menu1/group1"&gt;
      &lt;/action&gt;
    &lt;/objectContribution&gt;
  &lt;/extension&gt;
  </code></pre>