Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » "Widget is disposed" from NatTable.handleLayerEvent()
"Widget is disposed" from NatTable.handleLayerEvent() [message #1818604] Fri, 20 December 2019 12:05 Go to next message
Tom Wheeler is currently offline Tom WheelerFriend
Messages: 10
Registered: June 2018
Junior Member
In our application we instantiate and dispose NatTable instances.
Sometimes our users run into this exception:

Quote:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-11-15 10:18:04.616
!MESSAGE Internal Error
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4552)
at org.eclipse.swt.SWT.error(SWT.java:4467)
at org.eclipse.swt.SWT.error(SWT.java:4438)
at org.eclipse.swt.widgets.Widget.error(Widget.java:448)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:347)
at org.eclipse.swt.widgets.Control.redraw(Control.java:2441)
at org.eclipse.nebula.widgets.nattable.NatTable.handleLayerEvent(NatTable.java:732)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:267)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:267)
at org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer.handleLayerEvent(CompositeFreezeLayer.java:111)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:267)
at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.handleLayerEvent(ViewportLayer.java:1315)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.fireCellSelectionEvent(SelectionLayer.java:592)
at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.clear(SelectionLayer.java:181)
at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.clear(SelectionLayer.java:168)
at org.eclipse.nebula.widgets.nattable.selection.SelectionModel.handleLayerEvent(SelectionModel.java:687)
at org.eclipse.nebula.widgets.nattable.selection.SelectionModel.handleLayerEvent(SelectionModel.java:1)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:261)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:267)
at org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer.handleLayerEvent(AbstractColumnHideShowLayer.java:50)
at org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer.handleLayerEvent(ColumnHideShowLayer.java:66)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:267)
at org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.handleLayerEvent(ColumnReorderLayer.java:133)
at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:307)
at org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer$2.run(GlazedListsEventLayer.java:136)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3906)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3537)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)


This is based on NatTable 1.5.0.

Is this a bug in NatTable that it does not run an isDisposed() check before processing the LayerEvent?

Or is there a recommended practice to follow when NatTable instances are created and disposed all the time?
Re: "Widget is disposed" from NatTable.handleLayerEvent() [message #1818606 is a reply to message #1818604] Fri, 20 December 2019 12:26 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2814
Registered: July 2012
Senior Member
I never met a reason to constantly dispose and recreate NatTable instances. As you can change the content and the configuration dynamically I wou not know a reason.

But yes, you can name it a bug that all redraw() calls are not wrapped by a dispose check. Checking on event level would prevent internal dispose mechanisms.

Feel free to open a bug ticket for this.
Previous Topic:Displaying Dialog for multi edit of checkbox.
Next Topic:Nattable saveState and loadState issue
Goto Forum:
  


Current Time: Mon Jun 14 21:57:06 GMT 2021

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

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

Back to the top