Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Unable to fully delete ("remove") Menus(After removing a Menu a shadow or ghost remains)
Unable to fully delete ("remove") Menus [message #1737803] Wed, 13 July 2016 07:17 Go to next message
DaveLaw Missing name is currently offline DaveLaw Missing nameFriend
Messages: 6
Registered: October 2015
Junior Member
After deleting some old Menus & adding some new Menus, the old deleted Menus remain as shadows or ghosts.

Selecting one of the old Menus leads to an Exception:
InjectionException: Unable to process "DirectContributionItem.contribFactory"

The following (simplified) code illustrates this...
	public static void rebuildMenus(final MMenu root) {

		final List<MMenuElement> childMenus = root.getChildren();

		childMenus.clear();

		final MDynamicMenuContribution contrib = MMenuFactory.INSTANCE.createDynamicMenuContribution();
		/**/                           contrib.setContributionURI("bundleclass://...");

		final MMenu newMenu = MMenuFactory.INSTANCE.createMenu();
		/**/        newMenu.setLabel  ("Label");
		/**/        newMenu.setVisible(true);
		/**/        newMenu.getChildren().add(contrib);

		childMenus.add(newMenu);
	}


As a workaround, we are setting the removed Items to visible(false) but this just amounts to sweeping the dust under the carpet.

Anyone have a solution to this?

Platform: Eclipse RCP Mars 2 on Windows 10 x64

Here's the associated Stacktrace:
org.eclipse.e4.core.di.InjectionException: Unable to process "DirectContributionItem.contribFactory": no actual value was found for the argument "IContributionFactory".
	at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:424)
	at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:415)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:110)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:345)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processDirectItem(MenuManagerRenderer.java:806)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.modelProcessSwitch(MenuManagerRenderer.java:703)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerShowProcessor.processDynamicElements(MenuManagerShowProcessor.java:188)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerShowProcessor.menuAboutToHide(MenuManagerShowProcessor.java:109)
	at org.eclipse.jface.internal.MenuManagerEventHelper.showEventPostHelper(MenuManagerEventHelper.java:92)
	at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:467)
	at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:461)
	at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:493)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1118)
	at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:5037)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1633)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2117)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4774)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1633)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2117)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4774)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1633)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2117)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:159)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Re: Unable to fully delete ("remove") Menus [message #1737882 is a reply to message #1737803] Wed, 13 July 2016 18:39 Go to previous messageGo to next message
Eddie Crawford is currently offline Eddie CrawfordFriend
Messages: 5
Registered: July 2016
Junior Member
Have you tried clearing the workspace upon launching?

Within Run Configuration > Main Tab > Select Clear Workspace

With my RCP Experience, if you created menu contributions, the e4 app model will keep them present even if they do not handle anything.
Give this a shot and see what happens.
Re: Unable to fully delete ("remove") Menus [message #1738031 is a reply to message #1737882] Fri, 15 July 2016 08:46 Go to previous messageGo to next message
DaveLaw Missing name is currently offline DaveLaw Missing nameFriend
Messages: 6
Registered: October 2015
Junior Member
We're not starting it from the IDE.
Re: Unable to fully delete ("remove") Menus [message #1738101 is a reply to message #1738031] Fri, 15 July 2016 17:43 Go to previous messageGo to next message
Eddie Crawford is currently offline Eddie CrawfordFriend
Messages: 5
Registered: July 2016
Junior Member
Have you tried starting your RCP in clean mode?

if set to "true", any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.

./eclipse -clean
Re: Unable to fully delete ("remove") Menus [message #1738252 is a reply to message #1738101] Mon, 18 July 2016 13:06 Go to previous message
DaveLaw Missing name is currently offline DaveLaw Missing nameFriend
Messages: 6
Registered: October 2015
Junior Member
I'm sure we're starting completely clean.
I think this is probably an Eclipse RCP Bug...
Previous Topic:Invalid Buddle Context after Upgrading to 3.3
Next Topic:Error during eclipse product export
Goto Forum:
  


Current Time: Sat Apr 20 06:19:27 GMT 2024

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

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

Back to the top