Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] Observable TreeViewer
[DataBinding] Observable TreeViewer [message #322471] Mon, 19 November 2007 12:30 Go to next message
Eclipse UserFriend
Hi there,

Pardon the quasi-cross-posting with eclipse.platform.rcp, but I read in
http://wiki.eclipse.org/JFace_Data_Binding/FAQ that I might get a better
response here ...

Databinding with a TableViewer is elegant, à la:

ObservableListContentProvider viewerContentProviderList = new
ObservableListContentProvider();
viewer.setContentProvider(viewerContentProviderList);
//
IObservableMap[] viewerLabelProviderMaps =
BeansObservables.observeMaps(viewerContentProviderList.getKn ownElements(),
TaxonName.class, new String[]{"name"});
viewer.setLabelProvider(new
ObservableMapLabelProvider(viewerLabelProviderMaps));
//
IObservableList olObjectListObserveList =
BeansObservables.observeList(Realm.getDefault(),
Activator.getDefault().getTaxonList(), "objectList");
viewer.setInput(olObjectListObserveList);

However, I need to do something similar with a TreeViewer, and am at a
loss as to where or whether I can find something akin to
ObservableListContentProvider for TreeViewer content.

Any help greatly appreciated!

Cheers,
Pepe
Re: [DataBinding] Observable TreeViewer [message #322477 is a reply to message #322471] Mon, 19 November 2007 13:44 Go to previous messageGo to next message
Eclipse UserFriend
Pepe Ciardelli wrote:
> However, I need to do something similar with a TreeViewer, and am at a
> loss as to where or whether I can find something akin to
> ObservableListContentProvider for TreeViewer content.

ObservableSetTreeContentProvider is in CVS somewhere, if you check out
the databinding sources you should find it.

I've written my own ObservableListTreeContentProvider, which I'm
contributing to JDB, however it is not well-tested at the moment. The
patch is in bugzilla 207858:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=207858

A known problem is that if equivalent nodes are present at multiple
points in the tree and one of them is removed, the content provider
loses track of the other equivalent nodes. Not a big deal if you're
just using the tree in view-only mode though.

Matthew
Re: [DataBinding] Observable TreeViewer [message #322616 is a reply to message #322477] Wed, 21 November 2007 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, Matthew!

I wasn't able to find ObservableSetTreeContentProvider in CVS in the
logical places, i.e. org.eclipse.core.databinding and
org.eclipse.jface.databinding, or org.eclipse.core.databinding.beans, for
that matter. Any idea where you might have seen it?

At any rate, I'll see what I can do with your
ObservableListTreeContentProvider tomorrow ...
Re: [DataBinding] Observable TreeViewer [message #322617 is a reply to message #322616] Wed, 21 November 2007 12:00 Go to previous messageGo to next message
Eclipse UserFriend
It's not in CVS search bugzilla.

Tom

Pepe Ciardelli schrieb:
> Thanks, Matthew!
>
> I wasn't able to find ObservableSetTreeContentProvider in CVS in the
> logical places, i.e. org.eclipse.core.databinding and
> org.eclipse.jface.databinding, or org.eclipse.core.databinding.beans,
> for that matter. Any idea where you might have seen it?
>
> At any rate, I'll see what I can do with your
> ObservableListTreeContentProvider tomorrow ...
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [DataBinding] Observable TreeViewer [message #322671 is a reply to message #322617] Fri, 23 November 2007 11:43 Go to previous message
Eclipse UserFriend
Originally posted by: bokowski.ca.ibm.com

Actually, it is in org.eclipse.jface.databinding, just under a different
name: UnorderedTreeContentProvider

"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:fi1o6m$5ot$1@build.eclipse.org...
> It's not in CVS search bugzilla.
>
> Tom
>
> Pepe Ciardelli schrieb:
>> Thanks, Matthew!
>>
>> I wasn't able to find ObservableSetTreeContentProvider in CVS in the
>> logical places, i.e. org.eclipse.core.databinding and
>> org.eclipse.jface.databinding, or org.eclipse.core.databinding.beans, for
>> that matter. Any idea where you might have seen it?
>>
>> At any rate, I'll see what I can do with your
>> ObservableListTreeContentProvider tomorrow ...
>>
>
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
Previous Topic:which extension point to add library to eclipse?
Next Topic:Building update site with platform-specific fragments
Goto Forum:
  


Current Time: Thu Jul 10 02:16:41 EDT 2025

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

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

Back to the top