سؤال

I am stuck with this issue since yesterday. I want to disable (or hide) the default eclipse rename menu item under file contextual menu.

I was able to hide the one under right click menu using activities like:

<extension point="org.eclipse.ui.activities">
    <activity id="rename.disable" name="Hidden activities">
       <enabledWhen>
         <not> <reference  definitionId="DataEnginePlugin.testProjectNatureExtension"/></not>
       </enabledWhen>
    </activity>
    <activityPatternBinding activityId="rename.disable" pattern="org.eclipse.ui.edit.rename"/>
    </extension>

But, i am not able to disable the global one under File menu (F2).

Any ideas please!! Thanks

هل كانت مفيدة؟

المحلول

The format of the pattern for the activityPatternBinding is 'contributing plugin id / item id'. Also the default pattern is a regular expression, you want an exact match here. So you want:

<activityPatternBinding 
  isEqualityPattern="true"
  activityId="rename.disable" 
  pattern="org.eclipse.ui/org.eclipse.ui.edit.rename"/>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top