title: Disable Eclipse Rename Context Menu
body: <p>I am working on an RCP application and I want to disable the Rename context menu under File menu. I tried a few approaches but unfortunately none of them worked for me. Following is what I have tried so far.</p>
  
  <p><strong>Using activities</strong></p>
  
  <pre><code> &lt;extension
       point="org.eclipse.ui.activities"&gt;
    &lt;activity
          id="disableRenameContextMenu"
          name="Disable Rename Context Menu"&gt;
          &lt;enabledWhen&gt;
             &lt;not&gt;
                &lt;test
                   property="com.session.ui.IsSessionActive"&gt;
                &lt;/test&gt;
             &lt;/not&gt;
       &lt;/enabledWhen&gt;
    &lt;/activity&gt;
    &lt;activityPatternBinding
          activityId="disableRenameContextMenu"
          pattern="org.eclipse.ui.edit.rename"&gt;
    &lt;/activityPatternBinding&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Using Perspective Extensions</strong></p>
  
  <pre><code>&lt;extension
       point="org.eclipse.ui.perspectiveExtensions"&gt;
    &lt;perspectiveExtension
          targetID="com.perspectives.MyPerspective"&gt;
       &lt;hiddenMenuItem
             id="org.eclipse.ui.edit.rename"&gt;
       &lt;/hiddenMenuItem&gt;
    &lt;/perspectiveExtension&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Using Command Handler</strong></p>
  
  <pre><code>&lt;extension
     point="org.eclipse.ui.handlers"&gt;
   &lt;handler
      class=""
      commandId="org.eclipse.ui.edit.rename"&gt;
   &lt;enabledWhen&gt;
      &lt;not&gt;
          &lt;test
              property="com.session.ui.IsSessionActive"&gt;
          &lt;/test&gt;
       &lt;/not&gt;
   &lt;/enabledWhen&gt;
  </code></pre>
  
  <p></p>
  
  <p>Is there any way I can disable the Rename context menu? Am I doing anything wrong in the above approaches. any help will be highly appreciated.</p>
  
  <p>Thanks </p>