Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » menu not registry in fragment
menu not registry in fragment [message #1080925] Tue, 06 August 2013 14:54 Go to next message
bernard loiseau is currently offline bernard loiseauFriend
Messages: 4
Registered: August 2013
Junior Member
Hello ,
First of all thank you in advance for your help.
I have created a part inside a fragment and in this part via the application model i created a popupMenu .
In my part i inject EMenuService , it wasn't null but when i try to registry the menu it causes an exception :
!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-08-06 16:49:17.827
!MESSAGE Unable to create class 'TestBrowser' from bundle '566'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException: A handle object may not have a null identifier
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1096)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4688)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$9.widgetSelected(StackRenderer.java:885)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:778)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3061)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1753)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:278)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.NullPointerException: A handle object may not have a null identifier
	at org.eclipse.core.commands.common.HandleObjectManager.checkId(HandleObjectManager.java:55)
	at org.eclipse.core.commands.CommandManager.getCommand(CommandManager.java:546)
	at org.eclipse.e4.core.commands.internal.CommandServiceImpl.getCommand(CommandServiceImpl.java:95)
	at org.eclipse.e4.core.commands.internal.CommandServiceImpl.createCommand(CommandServiceImpl.java:43)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.generateCommand(HandledContributionItem.java:303)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.setModel(HandledContributionItem.java:283)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processHandledItem(MenuManagerRenderer.java:740)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.modelProcessSwitch(MenuManagerRenderer.java:601)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processMenu(MenuManagerRenderer.java:580)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.modelProcessSwitch(MenuManagerRenderer.java:613)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processContents(MenuManagerRenderer.java:535)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuService.registerMenu(MenuService.java:74)
	at org.eclipse.e4.ui.workbench.swt.modeling.MenuService.registerContextMenu(MenuService.java:37)
	at TestBrowser.registerMenu(TestBrowser.java:70)
	at TestBrowser.createControls(TestBrowser.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	... 67 more


and at the line 70 in my test browser i registry my menu like:
private void registerMenu(TreeViewer treeViewer) {
		System.out.println(menu);
		menu.registerContextMenu(treeViewer.getControl(),
				"com.itf.tvt.tool.test.gui.part.testbrowser.popupmenu.popup");


I don't understand why the menu cannot registry (sysout of menu :org.eclipse.e4.ui.workbench.swt.modeling.MenuService@393f4ebd)
Re: menu not registry in fragment [message #1080943 is a reply to message #1080925] Tue, 06 August 2013 15:26 Go to previous messageGo to next message
anthony palmieri is currently offline anthony palmieriFriend
Messages: 20
Registered: July 2013
Junior Member
Hello ,
You may have not define handler in your menu
Re: menu not registry in fragment [message #1081707 is a reply to message #1080943] Wed, 07 August 2013 15:31 Go to previous messageGo to next message
bernard loiseau is currently offline bernard loiseauFriend
Messages: 4
Registered: August 2013
Junior Member
thank that it !
But my handledtoolitem are always grey have you an idea ?
thans for you help
Re: menu not registry in fragment [message #1081709 is a reply to message #1080925] Wed, 07 August 2013 15:35 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Are you certain your fragment is being loaded/merged into the model correctly?

JD
Re: menu not registry in fragment [message #1082335 is a reply to message #1081709] Thu, 08 August 2013 12:28 Go to previous message
bernard loiseau is currently offline bernard loiseauFriend
Messages: 4
Registered: August 2013
Junior Member
yes i have check it with the live editor , but when i look at my handledMenuItem the option "Select" is unchecked
Previous Topic:The correct place to get e4 tools source?
Next Topic:Open editors sorting
Goto Forum:
  


Current Time: Thu Nov 27 16:26:59 GMT 2014

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

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