Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Problem with disabling context menu items(Can't disable menu items through <extension point="org.eclipse.ui.activities">)
Problem with disabling context menu items [message #999077] Fri, 11 January 2013 09:31
Mladen Mijatovic is currently offline Mladen MijatovicFriend
Messages: 7
Registered: August 2011
Junior Member
I had tried to disable some context menu items through <extension point="org.eclipse.ui.activities"> extension point. I had tried following:

In org.eclipse.ui.navigator.resources plugin.xml added code:
<extension
       point="org.eclipse.ui.activities">
    <activity
       id="org.eclipse.ui.navigator.resources.activity.disableForProjectTypeOne"
       name="Disable For Project Type One">
       <enabledWhen>
          <with
                variable="selection">
             <or>
                <iterate
                      ifEmpty="false">
                   <not>
                      <adapt
                            type="org.eclipse.core.resources.IProject">
                         <test
                               property="org.eclipse.core.resources.projectNature"
                               value="com.maxeler.maxcompiler.core.myProjectOneNature">
                         </test>
                      </adapt>
                   </not>
                </iterate>
                <count
                      value="0">
                </count>
             </or>
          </with>
       </enabledWhen>
    </activity> 
    <activityPatternBinding
activityId="org.eclipse.ui.navigator.resources.activity.disableForProjectTypeOne"
          pattern=".*/org.eclipse.ui.navigator.resources.ResourceMgmtActions">
    </activityPatternBinding>  
    <activity
          id="org.eclipse.ui.navigator.resources.activity.disableForProjectTypeTwo"
          name="Disable For Project Type Two">
       <enabledWhen>
          <with
                variable="selection">
             <or>
                <iterate
                      ifEmpty="false">
                   <not>
                   <or>
                      <adapt
                            type="org.eclipse.core.resources.IProject">
                         <test
                               property="org.eclipse.core.resources.projectNature"
                               value="com.maxeler.maxcompiler.core.myProjectTwoNature">
                         </test>
                      </adapt>
                      <adapt
                            type="org.eclipse.core.resources.IProfileFolder">
                      </adapt>
                   </or>
                   </not>
                </iterate>
                <count
                      value="0">
                </count>
             </or>
          </with>
       </enabledWhen>
    </activity> 
    <activityPatternBinding
          activityId="org.eclipse.ui.navigator.resources.activity.disableForProjectTypeTwo"
          pattern=".*/org.eclipse.ui.navigator.resources.ResourceMgmtActions">
    </activityPatternBinding>
    <activityPatternBinding
          activityId="org.eclipse.ui.navigator.resources.activity.disableForProjectTypeTwo"
          pattern=".*/org.eclipse.ui.navigator.resources.PortingActions">
    </activityPatternBinding>


Here the problem is that I have the same pattern (pattern=".*/org.eclipse.ui.navigator.resources.ResourceMgmtActions") in activity pattern bindings for both activities. It works when only one activity pattern binding is defined, but in this situation, when both of them are active it doesn't work for each of. Is this an Eclipse bug or I am missing something? Thanks in advance.
Previous Topic:Eclipse goes blank (entire UI turns white)
Next Topic:launch event that allow changes in arguments for the launched process ?
Goto Forum:
  


Current Time: Tue Dec 23 03:47:46 GMT 2014

Powered by FUDForum. Page generated in 0.01864 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software