CommonNavigator context menu issue [message #707429] |
Mon, 01 August 2011 12:38  |
Eclipse User |
|
|
|
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 12:39] by Moderator
|
|
|
|
Re: CommonNavigator context menu issue [message #1709985 is a reply to message #714957] |
Fri, 02 October 2015 09:16  |
Eclipse User |
|
|
|
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 ?
|
|
|
Powered by
FUDForum. Page generated in 0.03800 seconds