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:

 </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 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 Muhtar is currently offline ilke MuhtarFriend
Messages: 47
Registered: September 2015
Member
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: group.build


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: Tue Sep 24 22:37:56 GMT 2024

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

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

Back to the top