[Databinding] Re: newbie: How fire a changed value on a writable from a thread other than the real [message #331318] |
Mon, 01 September 2008 03:43  |
Eclipse User |
|
|
|
Hi,
1. Let's move this thread to eclipse.platform because this is where
databinding is discussed
2. My impression was always that this is exactly the task of the Realm
(syncing from back from a NONE-UI thread but I could be wrong here).
Tom
Lars Vogel schrieb:
> Hi Zos,
>
> if you use the bean binding the UI should be updated automatically. The
> bean will trigger the PropertyChangeListener and the UI will update. If
> you running into threat issues have a look here:
> http://wiki.eclipse.org/FAQ_Why_do_I_get_an_invalid_thread_a ccess_exception%3F
>
>
> Best regards, Lars
>
> Hzosrothko wrote:
>> Hello
>>
>> I have a JFaceDataBinding UI/Model communication based on the Writable
>> class. Everything is fine for updating values between the UI and the
>> Model, Thanks to the JFace team!!
>> but I have now to update a value in the model from a thread different
>> from the realm one, and this value should be reflected too in the UI.
>>
>> What is the best way to solve this problem ??
>>
>> TIA
>> zos
>>
>
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: [Databinding] Re: newbie: How fire a changed value on a writable from a thread other than the re [message #331329 is a reply to message #331318] |
Mon, 01 September 2008 17:11  |
Eclipse User |
|
|
|
Correct. Here's what you want to do:
final IObservableValue observable = ... // your observable
final Object newValue = ... // the new value you want to set
observable.getRealm().exec(new Runnable() {
public void run() {
observable.setValue(newValue);
}
});
Matthew
Tom Schindl wrote:
> Hi,
>
> 1. Let's move this thread to eclipse.platform because this is where
> databinding is discussed
> 2. My impression was always that this is exactly the task of the Realm
> (syncing from back from a NONE-UI thread but I could be wrong here).
>
> Tom
>
>
> Lars Vogel schrieb:
>> Hi Zos,
>>
>> if you use the bean binding the UI should be updated automatically.
>> The bean will trigger the PropertyChangeListener and the UI will
>> update. If you running into threat issues have a look here:
>> http://wiki.eclipse.org/FAQ_Why_do_I_get_an_invalid_thread_a ccess_exception%3F
>>
>>
>> Best regards, Lars
>>
>> Hzosrothko wrote:
>>> Hello
>>>
>>> I have a JFaceDataBinding UI/Model communication based on the
>>> Writable class. Everything is fine for updating values between the UI
>>> and the Model, Thanks to the JFace team!!
>>> but I have now to update a value in the model from a thread different
>>> from the realm one, and this value should be reflected too in the UI.
>>>
>>> What is the best way to solve this problem ??
>>>
>>> TIA
>>> zos
>>>
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02620 seconds