Community
Participate
Working Groups
When i want to customize the diagram elements colors (font color, line color or fill color) with the contextual menu "More colors", i choose the color and when ok is pressed, i have got this exception : Unhandled event loop exception java.lang.NullPointerException at org.eclipse.gmf.runtime.common.ui.action.AbstractContributionItem.getActionManager(AbstractContributionItem.java:504) at org.eclipse.gmf.runtime.common.ui.action.AbstractContributionItem.runWithEvent(AbstractContributionItem.java:529) at org.eclipse.gmf.runtime.diagram.ui.actions.internal.ColorPropertyContributionItem.handleEvent(ColorPropertyContributionItem.java:533) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Hi, it works for me on windows vista with logic diagram sample. Is there someone that can test on Windows 7? @Nathalie Did you do this via properties view or contextual menu? both? Do you choose a custom color or not? Which version of GMF are you using? Regards,
Created attachment 189305 [details] use ColorSelector and another event Ok,asked to colleagues and we have already fixed it. This is an issue on mac and Windows 7 I cleaned a little what we have done and no mac nor windows 7 to test. Can someone test on these platforms? thanks
Hi, I try with the provided patch, i've already have the same exception when i customize the color with the context menu. My GMF version is 2.2.2. Regards.
Created attachment 189505 [details] use a filter instead of a listener Ok, my bad, I wasn't understanding the real issue before. I uploaded a new patch. In fact, perhaps it is more relevant to report bug to SWT becuase they hae different behavior on SWT.Deactivate on a shell between WIndows vista, 7 and Mac You can try the patch provided.
Thanks for the new patch provided but it does not work either, i have the same exception.
It seems to work with Eclipse 3.3. In 3.5 and 3.6 a new method org.eclipse.ui.internal.WorkbenchWindow.liftRestrictions() is called during shellActivation, leading to update the contextual menu and dipose the current ColorPropertyContributionItem. The dispose remove the workbenchpart causing the NPE.
The contextual menu update is caused by a detected changes in menus (WorkbenchWindow.liftRestrictions()). It comes from one of our popup menu which is computed with visibleWhen > With expression based on activeMenuSelection. This variable is available just after right click. The click on "More colors" shows a ColorDialog/ColorSelector" in its own shell. The click on "Ok" quit this dialog, the workbench window is reactivated, the activeMenuSelection variables is not found, causing the call of WorkbenchMenuService.updateManager(). ColorPropertyContributionItem.dispose() leads to set a null WorkbenchPart. It causes the NullPointException in runWithEvent(Event). We changed the variable to selection, and the NPE no longer occurs.
Hi, so we can close the bug as NOT_ECLIPSE? regards,
Feel free to reopen and add a patch if it is an Eclipse bug
Hi, Sorry I did not see the notification mail. It was a NOT_ECLIPSE bug. Regards, (In reply to comment #8) > Hi, > > so we can close the bug as NOT_ECLIPSE? > > regards,