Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Databinding] Put data to a WritableMap from other Thread
[Databinding] Put data to a WritableMap from other Thread [message #1018151] Wed, 13 March 2013 09:10 Go to next message
Simon Scholz is currently offline Simon Scholz
Messages: 73
Registered: April 2012
Location: Germany
Member
Hello,

I do like to put data into a org.eclipse.core.databinding.observable.map.WritableMap from another Thread, but the checkRealm() method throws an AssertionFailedException Exception with the Message "This operation must be run within the observable's realm", because the current Realm of the WritableMap is not used.

So I tried to use Realm.getDefault().asyncExec(), but then Realm.getDefault() just returns null and causes an NPE Sad

Do you have an idea how databinding and multithreading can be combined?

Best regards,

Simon
Re: [Databinding] Put data to a WritableMap from other Thread [message #1018156 is a reply to message #1018151] Wed, 13 March 2013 09:26 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5422
Registered: July 2009
Senior Member
You need to get the realm from the WritableMap!

Tom

Am 13.03.13 10:10, schrieb Simon SSC:
> Hello,
>
> I do like to put data into a
> org.eclipse.core.databinding.observable.map.WritableMap from another
> Thread, but the checkRealm() method throws an AssertionFailedException
> Exception with the Message "This operation must be run within the
> observable's realm", because the current Realm of the WritableMap is not
> used.
>
> So I tried to use Realm.getDefault().asyncExec(), but then
> Realm.getDefault() just returns null and causes an NPE :(
>
> Do you have an idea how databinding and multithreading can be combined?
>
> Best regards,
>
> Simon
Re: [Databinding] Put data to a WritableMap from other Thread [message #1018184 is a reply to message #1018156] Wed, 13 March 2013 10:32 Go to previous message
Simon Scholz is currently offline Simon Scholz
Messages: 73
Registered: April 2012
Location: Germany
Member
Hello Tom,

I didnĀ“t expect such an easy answer.
Thanks a lot Smile

Best regards,

Simon
Previous Topic:jface treeviewer with 2 columns
Next Topic:dynamic dispose and create of treeviewer + columns
Goto Forum:
  


Current Time: Fri Oct 24 18:03:41 GMT 2014

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

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