Thursday, December 06, 2007

Looking for feedback: nested attributes in tables

Data binding makes it relatively easy to set up a table displaying 'live' data. You don't have to implement any listeners yourself. The first step is to use ObservableListContentProvider or ObservableSetContentProvider, and an observable set or list as the viewer's input. Then you can use ObservableMapLabelProvider to define the columns in your table.

But what about nested attributes in a table? For example, if you are writing a genealogy application, you would want to display the father's and mother's name in a table like this:



The 'tricky' part of this is that the cells for Mother and Father need to update on two conditions - when the name of a father or mother changes, or when the parent relationship between two persons changes.

I have a patch that implements this and a new snippet, and am looking for feedback. See bug 196785.

Note that this is only the low-level machinery; we have some thoughts about making this easer to set up in bug 144260.