chemclipse icon indicating copy to clipboard operation
chemclipse copied to clipboard

UI crash of ExtendedTableViewer of PeakTable and MeasurmentResult

Open lorenzgerber opened this issue 6 years ago • 6 comments

When selecting delete peak(s) / scan identification(s) from the peak list's context menu, a small pop-up appears in the chromatogram editor (Deselect all/Select all). When the user now, while this pop-up is still visible, right-clicks somewhere else in the chromatogram (for example to start a processor), the selected Processor never starts, instead a UI crash with the following stack trace occours:

!ENTRY org.eclipse.ui 4 0 2019-10-17 11:10:14.528
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:268)
	at org.eclipse.swt.widgets.Display.runPopups(Display.java:4157)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3699)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.chemclipse.rcp.app.ui.internal.support.ApplicationSupportDefault.start(ApplicationSupportDefault.java:26)
	at org.eclipse.chemclipse.rcp.app.ui.Application.start(Application.java:61)
	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:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	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:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

This happens consistently. The behaviour can be prevented by first clicking away the pop-up through a left click somewhere else in the chromatogram. But when working with peak lists, it's an annoying behaviour as it increases the number of needed clicks.

The context menu Deselect all/select all refers to the peak list. It seems however not useful to have this pop-up at all in the chain of deleting (a) peak(s).

lorenzgerber avatar Oct 17 '19 09:10 lorenzgerber

org.eclipse.swt.widgets.Menu._setVisible(Menu.java:268) seems to be related to SWT, can you try to take a look what the code does on this place for macos/cocoa?

laeubi avatar Oct 18 '19 05:10 laeubi

@laeubi https://github.com/eclipse/eclipse.platform.swt/blob/6bdf4f12c125b636189a4de55260df5a71775f2e/bundles/org.eclipse.swt/Eclipse%20SWT/cocoa/org/eclipse/swt/widgets/Menu.java#L243

lorenzgerber avatar Oct 18 '19 07:10 lorenzgerber

The same exception can be produced with the MeasurmentResult table or any other ExtendedTableViewer based table:

  1. right click into the table, a pop up appears
  2. select an entry, another probably 'default value' pop-up appears (select all/deselect all)
  3. while the pop-up is active, right click into the chromatogram editor and select a processor -> the above described exception occurs

lorenzgerber avatar Oct 18 '19 13:10 lorenzgerber

Screenshot 2019-10-18 at 15 48 12 Screenshot 2019-10-18 at 15 48 20

lorenzgerber avatar Oct 18 '19 13:10 lorenzgerber

Under Linux the following happens:

  1. The PopUp Menu appears and is closed after a few miliseconds
  2. the one has to reopen the poup once again and it works fine

Under MacOS, this triggers the Eclipse Bug 552223, because Cocoa works different by not closing the popup on dispose and then works on a disposed instance.

I think this behavior should be fixed, as it requires 3(!) clicks to open the poup menu if the Chromatogram editor does not own the focus and would workaround the cocoa issue.

laeubi avatar Oct 18 '19 16:10 laeubi

Is this still a problem on macOS?

Mailaender avatar Mar 29 '22 13:03 Mailaender