Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » New databinding idiom
New databinding idiom [message #335780] Wed, 29 April 2009 13:26 Go to next message
Eclipse UserFriend
Originally posted by: gaston.tonietti.teracode.com

Hi all,

I've seen here: http://fire-change-event.blogspot.com/ some databinding
examples using new API from 3.5 builds, and I liked it too much.

So the question is, if I want to migrate my old databinding code to the new
style, where can I start reading some documentation?

Maybe a migration path or an old/new comparative table or any other kind of
documentation about the new way of doing databinding.

Thanks a lot.
Gaston.
Re: New databinding idiom [message #335782 is a reply to message #335780] Wed, 29 April 2009 15:21 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Gaston,

See responses below.

> I've seen here: http://fire-change-event.blogspot.com/ some databinding
> examples using new API from 3.5 builds, and I liked it too much.

I'm glad you like it!

I'm assuming you're talking about the properties API vs the existing
observable factory API, e.g.:

BeansObservables.observeValue(bean, "name")
vs.
BeanProperties.value("name").observe(bean)

> So the question is, if I want to migrate my old databinding code to the new
> style, where can I start reading some documentation?

First let me say that you don't *have* to migrate your code; existing
code will continue to work without modification. However if you want to
use the property API as a matter of personal taste then you could
certainly do that.

> Maybe a migration path or an old/new comparative table or any other kind of
> documentation about the new way of doing databinding.

If you could provide some examples of existing code that you want to
migrate, I'd be happy to convert it to use the IProperty APIs.

Other than a case-by-case basis the only other thing I'd recommend you
look at is the ViewerSupport class, which uses properties to make
binding a viewer very simple.

Matthew
Re: New databinding idiom [message #335784 is a reply to message #335782] Wed, 29 April 2009 18:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gaston.tonietti.teracode.com

I understand it is more an API extension than a replacement, so it is just
as you said, I want to use it when possible as I like it more.

I'm not concerning with viewers that much as I have a few views (one tree
and some tables) but I will take a look at ViewerSupport for sure since it
seems very powerful.

My main concern is for forms, I make extensive use of eclipse forms in my
application's editors, so I like the new Property API for binding form
fields with domain objects properties.

So, I think I should pay special attention to WidgetProperties and
BeanProperties clases, also to DuplexingObservableValue as my editors
support bulk edition.

Is it right?

Thanks in advance.
Gaston.


Matthew Hall wrote:

> Gaston,
>
> See responses below.
>
>> I've seen here: http://fire-change-event.blogspot.com/ some databinding
>> examples using new API from 3.5 builds, and I liked it too much.
>
> I'm glad you like it!
>
> I'm assuming you're talking about the properties API vs the existing
> observable factory API, e.g.:
>
> BeansObservables.observeValue(bean, "name")
> vs.
> BeanProperties.value("name").observe(bean)
>
>> So the question is, if I want to migrate my old databinding code to the
>> new style, where can I start reading some documentation?
>
> First let me say that you don't *have* to migrate your code; existing
> code will continue to work without modification. However if you want to
> use the property API as a matter of personal taste then you could
> certainly do that.
>
>> Maybe a migration path or an old/new comparative table or any other kind
>> of documentation about the new way of doing databinding.
>
> If you could provide some examples of existing code that you want to
> migrate, I'd be happy to convert it to use the IProperty APIs.
>
> Other than a case-by-case basis the only other thing I'd recommend you
> look at is the ViewerSupport class, which uses properties to make
> binding a viewer very simple.
>
> Matthew
Re: New databinding idiom [message #335786 is a reply to message #335782] Wed, 29 April 2009 20:01 Go to previous messageGo to next message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Matthew, ideally you would write at least a new&noteworthy paragraph about
the new API...

Boris

"Matthew Hall" <matthall@woodcraftmill.com> wrote in message
news:gt9ra5$2vo$1@build.eclipse.org...
> Gaston,
>
> See responses below.
>
>> I've seen here: http://fire-change-event.blogspot.com/ some databinding
>> examples using new API from 3.5 builds, and I liked it too much.
>
> I'm glad you like it!
>
> I'm assuming you're talking about the properties API vs the existing
> observable factory API, e.g.:
>
> BeansObservables.observeValue(bean, "name")
> vs.
> BeanProperties.value("name").observe(bean)
>
>> So the question is, if I want to migrate my old databinding code to the
>> new style, where can I start reading some documentation?
>
> First let me say that you don't *have* to migrate your code; existing code
> will continue to work without modification. However if you want to use
> the property API as a matter of personal taste then you could certainly do
> that.
>
>> Maybe a migration path or an old/new comparative table or any other kind
>> of documentation about the new way of doing databinding.
>
> If you could provide some examples of existing code that you want to
> migrate, I'd be happy to convert it to use the IProperty APIs.
>
> Other than a case-by-case basis the only other thing I'd recommend you
> look at is the ViewerSupport class, which uses properties to make binding
> a viewer very simple.
>
> Matthew
Re: New databinding idiom [message #335791 is a reply to message #335786] Wed, 29 April 2009 21:42 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
That's a good reminder, when is the deadline for M7?

Matthew

Boris Bokowski wrote:
> Matthew, ideally you would write at least a new&noteworthy paragraph about
> the new API...
>
> Boris
>
> "Matthew Hall" <matthall@woodcraftmill.com> wrote in message
> news:gt9ra5$2vo$1@build.eclipse.org...
>> Gaston,
>>
>> See responses below.
>>
>>> I've seen here: http://fire-change-event.blogspot.com/ some databinding
>>> examples using new API from 3.5 builds, and I liked it too much.
>> I'm glad you like it!
>>
>> I'm assuming you're talking about the properties API vs the existing
>> observable factory API, e.g.:
>>
>> BeansObservables.observeValue(bean, "name")
>> vs.
>> BeanProperties.value("name").observe(bean)
>>
>>> So the question is, if I want to migrate my old databinding code to the
>>> new style, where can I start reading some documentation?
>> First let me say that you don't *have* to migrate your code; existing code
>> will continue to work without modification. However if you want to use
>> the property API as a matter of personal taste then you could certainly do
>> that.
>>
>>> Maybe a migration path or an old/new comparative table or any other kind
>>> of documentation about the new way of doing databinding.
>> If you could provide some examples of existing code that you want to
>> migrate, I'd be happy to convert it to use the IProperty APIs.
>>
>> Other than a case-by-case basis the only other thing I'd recommend you
>> look at is the ViewerSupport class, which uses properties to make binding
>> a viewer very simple.
>>
>> Matthew
>
>
Re: New databinding idiom [message #335792 is a reply to message #335784] Wed, 29 April 2009 22:09 Go to previous message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Gaston M. Tonietti wrote:
> I understand it is more an API extension than a replacement, so it is just
> as you said, I want to use it when possible as I like it more.

I've been doing the same thing, although I tend to migrate existing code
as I go rather than trying to do everything at once.

> My main concern is for forms, I make extensive use of eclipse forms in my
> application's editors, so I like the new Property API for binding form
> fields with domain objects properties.
>
> So, I think I should pay special attention to WidgetProperties and
> BeanProperties clases, also to DuplexingObservableValue as my editors
> support bulk edition.

It sounds like you've got a good handle on it. The only thing I would
suggest is to familiarize yourself with all of the new property factory
classes:

org.eclipse.core.databinding.BindingProperties -
DataBindingContext#validationStatusProviders, DBC#bindings,
Binding#model, Binding#target, ValidationStatusProvider#models,
VSP#targets, VSP#validationStatus

org.eclipse.core.databinding.property.Properties - general purpose
properties such as self properties, the value of an IObservableValue.

org.eclipse.core.databinding.beans.BeanProperties - beans

org.eclipse.core.databinding.beans.PojoProperties - pojos

org.eclipse.jface.databinding.swt.WidgetProperties - SWT widgets

org.eclipse.jface.databinding.util.JFaceProperties - properties using
the JFace IPropertyChangeListener listener interface

org.eclipse.jface.databinding.viewers.CellEditorProperties -
CellEditor#control property, useful for building nested properties e.g.
TextCellEditor.control.text. Use in conjunction with
ObservableValueEditingSupport.create()

org.eclipse.jface.databinding.viewers.ViewerProperties - Viewer single-
or multiple-selection, checked elements, filters, input

Matthew
Previous Topic:Reusing the Tabbed Properties
Next Topic:Unable to launch Eclipse on SLES 11 (PPC) from remote X Client
Goto Forum:
  


Current Time: Mon Nov 24 16:32:50 GMT 2014

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

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