[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Re: [DataBinding] AssertionFailedException: "null argument" when using DataBindingContext's default constructor
|
The workbench sets the default realm for you (or you can use
Realm.runWithDefault) but this will only set the default realm for the UI
thread. If you start other threads (directly, or through scheduling a Job,
or IRunnableContext.run), welcome to the wonderful world of multi-threaded
programming where you start having to worry about things that you didn't
even know existed before.
What exactly are you trying to do in your runnable? It will be executed by a
separate thread. From that thread, you cannot just access observables and a
data binding context that was created using the default realm, like you
cannot just call methods on SWT widgets.
Have a look at this wiki page, does it explain what's going on?
http://wiki.eclipse.org/JFace_Data_Binding/Realm
If not, what questions does it leave open?
Boris
"Tom Schindl" <tom.schindl@xxxxxxxxxxxxxxx> wrote in message
news:gecisc$2rv$1@xxxxxxxxxxxxxxxxxxxx
> The workbench already does this when to starts up.
>
> Tom
>
> Sebastian Paul schrieb:
>> Matthew Hall wrote:
>>> Wrap you app's main() instructions in a call to:
>>>
>>> The default realm is set using a call to Realm.runWithDefault(Realm,
>>> Runnable). The default realm is set while the runnable is running,
>>> and is set to the previous realm after the runnable completes.
>>>
>>> Most of my apps have a main method that looks like this:
>>>
>>> Display display = new Display();
>>> Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
>>> public void run() {
>>> // create and open main application window
>>> }
>>> });
>>
>> Ah thank you, the missing piece.
>> We have an RCP application here. Any idea who to do it in an elegant way?
>>
>> I'm still lacking good documentation. I found some short tutorials
>> covering just the basics.
>>
>> Kind regards, Sebastian
>
>
> --
> B e s t S o l u t i o n . at
> --------------------------------------------------------------------
> Tom Schindl JFace-Committer
> --------------------------------------------------------------------