Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CommonNavigator context menu issue
CommonNavigator context menu issue [message #707429] Mon, 01 August 2011 16:38 Go to next message
i82orbom is currently offline i82orbom
Messages: 2
Registered: August 2011
Junior Member
Hi there, I am developing a rcp, and I have some problems with Project Explorer (CommonNavigator).

I have a view which corresponds to a CommonNavigator, its class associated is: org.eclipse.ui.navigator.CommonNavigator, when I've created the view, a point extension is added to the list, as the capture: h t tp: //i. imgur. com /bGfy6.png (sorry i haven't enough messages)

Well at this point, I've noticed that the contextual menu in the explorer, have items that i don't need. I have modified my plugin.xml as this:

 </extension>
   <extension
         point="org.eclipse.ui.navigator.viewer">
         
         <viewer
               viewerId="predatagui.navigator.ProjectNavigator">
               <popupMenu>
             allowPlatformContributions="false"
             
            <insertionPoint
              name="group.new"
              separator="true">
        	</insertionPoint>
        	
        	<insertionPoint
              name="group.port"
              separator="true">
        	</insertionPoint>
        		
        	<insertionPoint
              name="group.edit"
              separator="true">
        	</insertionPoint>
        
           <insertionPoint
              name="group.reorganize"
              separator="true">
       	   </insertionPoint>
       
               </popupMenu>
         </viewer> [......] 


I want only these groups, with the default actions. But groups that are not defined, is a problem, because since the application try to add actions to these groups, many exceptions are thrown.

java.lang.IllegalArgumentException: Group not found: group.build
	at org.eclipse.jface.action.ContributionManager.addToGroup(ContributionManager.java:131)
	at org.eclipse.jface.action.ContributionManager.appendToGroup(ContributionManager.java:138)
	at org.eclipse.ui.internal.navigator.resources.actions.ResourceMgmtActionProvider.fillContextMenu(ResourceMgmtActionProvider.java:157)
	at org.eclipse.ui.navigator.NavigatorActionService$2.run(NavigatorActionService.java:221)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.navigator.NavigatorActionService.addCommonActionProviderMenu(NavigatorActionService.java:216)
	at org.eclipse.ui.navigator.NavigatorActionService.fillContextMenu(NavigatorActionService.java:173)
	at org.eclipse.ui.navigator.CommonNavigatorManager.fillContextMenu(CommonNavigatorManager.java:260)
	at org.eclipse.ui.navigator.CommonNavigatorManager$4.menuAboutToShow(CommonNavigatorManager.java:275)


Also, in that contextual menu, I have options like Run As, Debug As, Team, etc..., but when i pass the mouse over it, the next time that the contextual menu is opened, they disappear.

So, my two questions are:

1. How to get rid of exceptions
2. How to get rid about the options last discussed (run as, debug as....)


Thank you in advance!

[Updated on: Mon, 01 August 2011 16:39]

Report message to a moderator

Re: CommonNavigator context menu issue [message #714957 is a reply to message #707429] Thu, 11 August 2011 21:58 Go to previous message
Francis Upton IV is currently offline Francis Upton IV
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
In your viewerActionBinding you are picking up all of the stuff from org.eclipse.ui.navigator.resources.\* which you probably don't want (that's what's triggering the stack trace you have). Specify the regular expressions there to pick up only the actions that you want (see the org.eclipse.ui.navigator.resources plugin).

Previous Topic:[CNF] CommonViewer label provider
Next Topic:CommonNavigator: removing the "Link with Editor" button
Goto Forum:
  


Current Time: Thu Oct 02 14:31:49 GMT 2014

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

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