Skip to main content



      Home
Home » Eclipse Projects » JFace » SWTException: Invalid thread access when binding in non-UI thread
SWTException: Invalid thread access when binding in non-UI thread [message #12141] Mon, 08 June 2009 13:53 Go to next message
Eclipse UserFriend
I'm binding two observables - SWT Text to a WritableValue. They are in
different realms and I'm doing the binidng in a non-UI thread.

DataBindingContext#bindValue throws and SWTException because it tries to add
a listener to a widget without executing the code in the display realm:

org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355)
at org.eclipse.swt.widgets.Widget.addListener(Widget.java:181)
at
org.eclipse.jface.internal.databinding.swt.SWTVetoableValueD ecorator.firstListenerAdded(SWTVetoableValueDecorator.java:6 9)
at
org.eclipse.core.databinding.observable.ChangeManager.addLis tener(ChangeManager.java:70)
at
org.eclipse.core.databinding.observable.value.DecoratingObse rvableValue.addValueChangeListener(DecoratingObservableValue .java:44)
at org.eclipse.core.databinding.ValueBinding.<init>(ValueBinding.java:73)
at
org.eclipse.core.databinding.DataBindingContext.bindValue(Da taBindingContext.java:155)
at
org.eclipse.core.databinding.DataBindingContext.bindValue(Da taBindingContext.java:121)

Shouldn't DataBindingContext respect the Realm for adding listeners?

-Will
Re: SWTException: Invalid thread access when binding in non-UI thread [message #14098 is a reply to message #12141] Wed, 10 June 2009 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Will,

I think you are right, this looks like a bug. Can you please file one in
Bugzilla, against Eclipse/Platform/UI? Thanks!

Boris

"Will Horn" <will.horn@gmail.com> wrote in message
news:h0jj7l$au7$1@build.eclipse.org...
> I'm binding two observables - SWT Text to a WritableValue. They are in
> different realms and I'm doing the binidng in a non-UI thread.
>
> DataBindingContext#bindValue throws and SWTException because it tries to
> add a listener to a widget without executing the code in the display
> realm:
>
> org.eclipse.swt.SWTException: Invalid thread access
> at org.eclipse.swt.SWT.error(SWT.java:3884)
> at org.eclipse.swt.SWT.error(SWT.java:3799)
> at org.eclipse.swt.SWT.error(SWT.java:3770)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355)
> at org.eclipse.swt.widgets.Widget.addListener(Widget.java:181)
> at
> org.eclipse.jface.internal.databinding.swt.SWTVetoableValueD ecorator.firstListenerAdded(SWTVetoableValueDecorator.java:6 9)
> at
> org.eclipse.core.databinding.observable.ChangeManager.addLis tener(ChangeManager.java:70)
> at
> org.eclipse.core.databinding.observable.value.DecoratingObse rvableValue.addValueChangeListener(DecoratingObservableValue .java:44)
> at org.eclipse.core.databinding.ValueBinding.<init>(ValueBinding.java:73)
> at
> org.eclipse.core.databinding.DataBindingContext.bindValue(Da taBindingContext.java:155)
> at
> org.eclipse.core.databinding.DataBindingContext.bindValue(Da taBindingContext.java:121)
>
> Shouldn't DataBindingContext respect the Realm for adding listeners?
>
> -Will
Re: SWTException: Invalid thread access when binding in non-UI thread [message #17564 is a reply to message #14098] Fri, 26 June 2009 18:02 Go to previous message
Eclipse UserFriend
"Boris Bokowski" <Boris_Bokowski@ca.ibm.com> wrote in message
news:h0ollk$fp4$1@build.eclipse.org...
> I think you are right, this looks like a bug. Can you please file one in
> Bugzilla, against Eclipse/Platform/UI? Thanks!
Apologies for not following up sooner. Bug filed
(http://bugs.eclipse.org/281723) with testcase attached.

Will
Previous Topic:DataBindingContext for TableViewer in ViewPart
Next Topic:JFace Modeless Dialog
Goto Forum:
  


Current Time: Wed Apr 16 05:22:08 EDT 2025

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

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

Back to the top