Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Exception when nattable in dialog(And the dialog is opened and closed quickly after that)
Exception when nattable in dialog [message #1091352] Wed, 21 August 2013 11:43 Go to next message
Renso Lohuis is currently offline Renso LohuisFriend
Messages: 44
Registered: July 2012
Member
I get an exception when a dialog with a nattable is opened and closed quickly after that.
Nattable tries to refresh the table, but the table is already disposed.
I have this problem since I work with version 1.0.1. I did not see this is version 1.0.0 or before

I get the following Exception:

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	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:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.SWT.error(SWT.java:4247)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340)
	at org.eclipse.swt.widgets.ScrollBar.getEnabled(ScrollBar.java:238)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.recalculateVerticalScrollBar(ViewportLayer.java:707)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.setMinimumOriginY(ViewportLayer.java:163)
	at org.eclipse.nebula.widgets.nattable.viewport.event.ViewportEventHandler.handleLayerEvent(ViewportEventHandler.java:95)
	at org.eclipse.nebula.widgets.nattable.viewport.event.ViewportEventHandler.handleLayerEvent(ViewportEventHandler.java:1)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:214)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.handleLayerEvent(ViewportLayer.java:825)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:220)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:220)
	at org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer.handleLayerEvent(AbstractColumnHideShowLayer.java:50)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:220)
	at org.eclipse.nebula.widgets.nattable.hideshow.AbstractColumnHideShowLayer.handleLayerEvent(AbstractColumnHideShowLayer.java:50)
	at org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer.handleLayerEvent(ColumnHideShowLayer.java:64)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:220)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.handleLayerEvent(AbstractLayer.java:220)
	at org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer.handleLayerEvent(ColumnReorderLayer.java:95)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.fireLayerEvent(AbstractLayer.java:242)
	at org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer$2.run(GlazedListsEventLayer.java:126)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 20 more


In the code I see of GlazedListsEventLayer I see the following:

	protected void fireEventFromSWTDisplayThread(final ILayerEvent event) {
		if (!testMode && Display.getCurrent() == null) {
			Display.getDefault().asyncExec(new Runnable() {
				public void run() {
					fireLayerEvent(event);
				}
			});
		} else {
			fireLayerEvent(event);
		}
	}


That code was not changed recently, but may be some logic behind there.

Does anybody has the same problem?
Does anybody has a workaround?
Should I file a bug?
Re: Exception when nattable in dialog [message #1091471 is a reply to message #1091352] Wed, 21 August 2013 14:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
We know there is an issue caused by the scrollbar calculation. The issue you are seeing seems to be another one related to the same cause.

Edwin is currently looking at this, but it is not trivial to solve.
Re: Exception when nattable in dialog [message #1092066 is a reply to message #1091471] Thu, 22 August 2013 09:31 Go to previous messageGo to next message
Renso Lohuis is currently offline Renso LohuisFriend
Messages: 44
Registered: July 2012
Member
Thanks for your response!
Is there already a bug (number) I can track?

I understand that is not a real problem that occurs, but my users don't know that.
They see an exception (in a popup) and assume that something went wrong.

I don't know how I can catch the exception. Is there any way?
Or is there some other kind of workaround I can use meanwhile?
Re: Exception when nattable in dialog [message #1092109 is a reply to message #1092066] Thu, 22 August 2013 10:37 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I'm not sure if there is already a ticket you can track. We noticed that behavior in different scenarios.

I don't know a workaround as we don't even know what is causing the issues. We can reproduce it in several scenarios. For example if you try to resize a window so that only the column header is visible, the scrollbars go crazy as making the visible/invisible are causing resize events which will again cause recalculation of the scrollbars. Both issues doesn't seem to be related to each other, but in some way they are.
Re: Exception when nattable in dialog [message #1229049 is a reply to message #1092109] Wed, 08 January 2014 15:53 Go to previous messageGo to next message
Andreas Dietrich is currently offline Andreas DietrichFriend
Messages: 3
Registered: December 2012
Junior Member
Hi all,
I get exactly the same error on a nattable refresh!
Is there any Workaround available?
Renso, did you solve the Problem?

Many Thanks in Advance!
Re: Exception when nattable in dialog [message #1229064 is a reply to message #1229049] Wed, 08 January 2014 16:29 Go to previous messageGo to next message
Andreas Dietrich is currently offline Andreas DietrichFriend
Messages: 3
Registered: December 2012
Junior Member
Workaround: Override method handleLayerEvent(ILayerEvent Event) and catch SWTException.

columnReorderLayer = new ColumnReorderLayer(glazedListsEventLayer) {
			
	@Override
	public void handleLayerEvent(ILayerEvent event) {
		try {
			super.handleLayerEvent(event);
		} catch(SWTException e) {
			// do nothing
		}
	}
};
Re: Exception when nattable in dialog [message #1229107 is a reply to message #1229064] Wed, 08 January 2014 18:28 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Did you try to use the current development snapshot? We worked on the ViewportLayer at several places and most of the issues we noticed are solved there. Would be great if anybody could verify if this issue is solved there so the upcoming release is not containing such this error.
Previous Topic:Custom Painter in multi level header
Next Topic:Expected date of next release or patch
Goto Forum:
  


Current Time: Sat Apr 20 00:48:38 GMT 2024

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

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

Back to the top