Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Valuebinding: Model To Target Synchronisation
[Databinding] Valuebinding: Model To Target Synchronisation [message #327573] Fri, 25 April 2008 08:06 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.news.yahoo.de

Hi,

I'm starting some experiments with the eclipse data binding in RCP
applications.
In fact, I only have a simple Text widget to be synchronized with a double
in my domain model.

So that, the following code support should support such synchronization:

--
DataBindingContext context = new DataBindingContext();
context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
BeansObservables.observeValue(domainData, "amount"),
null, null);
--

The target to model synchronization works very well. Additionally, the
'amount' is represented in the Eclipse Property View as an editable value
(via a TextPropertyDescriptor). If I edit the 'amount' via the Property
View, I would expect that the corresponding txBox is updated (since the
data binding supports also a model to target sync).
However, the model to target sync doesn't work in that case.

Is there any idea why it doesn't works and how I can solve the problem?

Thanks
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327577 is a reply to message #327573] Fri, 25 April 2008 10:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Does you model fire PropertyChangeEvents and does it provide a
add/removePropertyChangeListener-method.

The bad thing in 3.3 is that you won't see an error in this case as far
as I remember but the symptoms are exactly like you describe them.

Tom

H.Mueller schrieb:
> Hi,
>
> I'm starting some experiments with the eclipse data binding in RCP
> applications.
> In fact, I only have a simple Text widget to be synchronized with a
> double in my domain model.
> So that, the following code support should support such synchronization:
>
> --
> DataBindingContext context = new DataBindingContext();
> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
> BeansObservables.observeValue(domainData, "amount"),
> null, null);
> --
>
> The target to model synchronization works very well. Additionally, the
> 'amount' is represented in the Eclipse Property View as an editable
> value (via a TextPropertyDescriptor). If I edit the 'amount' via the
> Property View, I would expect that the corresponding txBox is updated
> (since the data binding supports also a model to target sync).
> However, the model to target sync doesn't work in that case.
>
> Is there any idea why it doesn't works and how I can solve the problem?
>
> Thanks
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327578 is a reply to message #327577] Fri, 25 April 2008 10:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.news.yahoo.de

Yes, the model provides PropertyChangeEvents including their corresponding add and remove methods.
And in the set method of the 'amount' value a property change event is fired.

Hermann

Tom Schindl schrieb:
> Hi,
>
> Does you model fire PropertyChangeEvents and does it provide a
> add/removePropertyChangeListener-method.
>
> The bad thing in 3.3 is that you won't see an error in this case as far
> as I remember but the symptoms are exactly like you describe them.
>
> Tom
>
> H.Mueller schrieb:
>> Hi,
>>
>> I'm starting some experiments with the eclipse data binding in RCP
>> applications.
>> In fact, I only have a simple Text widget to be synchronized with a
>> double in my domain model.
>> So that, the following code support should support such synchronization:
>>
>> --
>> DataBindingContext context = new DataBindingContext();
>> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
>> BeansObservables.observeValue(domainData, "amount"),
>> null, null);
>> --
>>
>> The target to model synchronization works very well. Additionally, the
>> 'amount' is represented in the Eclipse Property View as an editable
>> value (via a TextPropertyDescriptor). If I edit the 'amount' via the
>> Property View, I would expect that the corresponding txBox is updated
>> (since the data binding supports also a model to target sync).
>> However, the model to target sync doesn't work in that case.
>>
>> Is there any idea why it doesn't works and how I can solve the problem?
>>
>> Thanks
>>
>
>
Re: [Databinding] Valuebinding: Model To Target Synchronisation [message #327581 is a reply to message #327578] Fri, 25 April 2008 10:38 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Then I'm afraid you'll need to provide a snippet for us to run and see
what's going on. Do you run youre application with -consoleLog to see if
there are any exceptions?

Tom

H.Mueller schrieb:
>
> Yes, the model provides PropertyChangeEvents including their
> corresponding add and remove methods.
> And in the set method of the 'amount' value a property change event is
> fired.
>
> Hermann
>
> Tom Schindl schrieb:
>> Hi,
>>
>> Does you model fire PropertyChangeEvents and does it provide a
>> add/removePropertyChangeListener-method.
>>
>> The bad thing in 3.3 is that you won't see an error in this case as
>> far as I remember but the symptoms are exactly like you describe them.
>>
>> Tom
>>
>> H.Mueller schrieb:
>>> Hi,
>>>
>>> I'm starting some experiments with the eclipse data binding in RCP
>>> applications.
>>> In fact, I only have a simple Text widget to be synchronized with a
>>> double in my domain model.
>>> So that, the following code support should support such synchronization:
>>>
>>> --
>>> DataBindingContext context = new DataBindingContext();
>>> context.bindValue(SWTObservables.observeText(txBox, SWT.Modify),
>>> BeansObservables.observeValue(domainData, "amount"),
>>> null, null);
>>> --
>>>
>>> The target to model synchronization works very well. Additionally,
>>> the 'amount' is represented in the Eclipse Property View as an
>>> editable value (via a TextPropertyDescriptor). If I edit the 'amount'
>>> via the Property View, I would expect that the corresponding txBox is
>>> updated (since the data binding supports also a model to target sync).
>>> However, the model to target sync doesn't work in that case.
>>>
>>> Is there any idea why it doesn't works and how I can solve the problem?
>>>
>>> Thanks
>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:Implementing an IPerspectiveFactory...
Next Topic:How to set 2 identical plugins in one Eclipse Platform?
Goto Forum:
  


Current Time: Tue Jul 16 18:55:21 GMT 2024

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

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

Back to the top