Skip to main content

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 i82orbomFriend
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:

         </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:
	at org.eclipse.jface.action.ContributionManager.addToGroup(
	at org.eclipse.jface.action.ContributionManager.appendToGroup(
	at org.eclipse.ui.internal.navigator.resources.actions.ResourceMgmtActionProvider.fillContextMenu(
	at org.eclipse.ui.navigator.NavigatorActionService$
	at org.eclipse.ui.navigator.NavigatorActionService.addCommonActionProviderMenu(
	at org.eclipse.ui.navigator.NavigatorActionService.fillContextMenu(
	at org.eclipse.ui.navigator.CommonNavigatorManager.fillContextMenu(
	at org.eclipse.ui.navigator.CommonNavigatorManager$4.menuAboutToShow(

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 messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
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).

Re: CommonNavigator context menu issue [message #1709985 is a reply to message #714957] Fri, 02 October 2015 13:16 Go to previous message
ilke Muhtaroglu is currently offline ilke MuhtarogluFriend
Messages: 44
Registered: September 2015
I have a similar problem. There is a bug in CDT. I want to overcome it with setContext Method. There I want to access the right-click menu (Context menu.) But ı probaly get the wrong menu with code and then Eclipse throws an exception that says

java.lang.IllegalArgumentException: Group not found:

MenuManager menu = (MenuManager) ((WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getActionBars().getMenuManager();
    menu = (MenuManager) menu.find( "project" );

If I access the menu this way it gives error, how can I access the right click menu of a project. The pop-up menu, the context menu so that I can make the "Build Project" item enabled.

This is probably this is the main menu of eclipse not context menu ? Any idea ?
Previous Topic:Eclipse RCP E3 Status Bar Message and Images
Next Topic:Multi-word org.eclipse.ui.keywords for preference page filter
Goto Forum:

Current Time: Fri Nov 27 09:36:04 GMT 2020

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

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

Back to the top