Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [DataBinding] add non-model intermediary elements with ObservableListTreeContentProvider
[DataBinding] add non-model intermediary elements with ObservableListTreeContentProvider [message #648350] Wed, 12 January 2011 14:23 Go to next message
Eclipse User
Originally posted by: matthias.koester.numberfour.eu

Hi,

I'm using ObservableListTreeContentProvider to create a tree view for an
EMF based model. Everything works fine, I especially like the EMF edit
integration. Now I want to group my object eContents based on their
feature. So currently my tree looks like:

Car
+Engine
+Tire
+Tire

Engine belongs to the feature engine and both Tire objects belong to the
tires feature. I want to display them as:
Car
+engine
+Engine
+tires
+Tire
+Tire

How can I achive sth. like that? Via a DelegatingListProperty? Does an
example exist for this use case?

Regards,
Matthias
Re: [DataBinding] add non-model intermediary elements with ObservableListTreeContentProvider [message #648352 is a reply to message #648350] Wed, 12 January 2011 14:49 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5407
Registered: July 2009
Senior Member
You can take a look at my e4 model editor who adds such virtual nodes.

There are 2 tricks I'm using to make it work:
a) I create virtual elements named VirtualEntry who them selves simply
wrap an IObservableList in my IObservableFactory
b) The IObservableSet I use to create IObservableMap is not the one I
retrieve from IObservableTreeContentProvider#getKnownElements() but
one that is cleared from the VirtualEntry instances

The code is in:
/cvsroot/eclipse/e4/org.eclipse.e4.tools/bundles/org.eclipse .e4.tools.emf.ui

Tom

Am 12.01.11 15:23, schrieb Matthias Köster:
> Hi,
>
> I'm using ObservableListTreeContentProvider to create a tree view for an
> EMF based model. Everything works fine, I especially like the EMF edit
> integration. Now I want to group my object eContents based on their
> feature. So currently my tree looks like:
>
> Car
> +Engine
> +Tire
> +Tire
>
> Engine belongs to the feature engine and both Tire objects belong to the
> tires feature. I want to display them as:
> Car
> +engine
> +Engine
> +tires
> +Tire
> +Tire
>
> How can I achive sth. like that? Via a DelegatingListProperty? Does an
> example exist for this use case?
>
> Regards,
> Matthias
Re: [DataBinding] add non-model intermediary elements with ObservableListTreeContentProvider [message #648507 is a reply to message #648352] Thu, 13 January 2011 10:12 Go to previous message
Eclipse User
Originally posted by: matthias.koester.numberfour.eu

Hi Tom,

Thanks for your hint, I already had a similar idea on my mind when I
wrote my post. But your example really helped, thx a lot!
Now I "just" need to hook up commands for adding and removing feature.
And copy & Paste.

Matthias

Am 12.01.11 15:49, schrieb Tom Schindl:
> You can take a look at my e4 model editor who adds such virtual nodes.
>
> There are 2 tricks I'm using to make it work:
> a) I create virtual elements named VirtualEntry who them selves simply
> wrap an IObservableList in my IObservableFactory
> b) The IObservableSet I use to create IObservableMap is not the one I
> retrieve from IObservableTreeContentProvider#getKnownElements() but
> one that is cleared from the VirtualEntry instances
>
> The code is in:
> /cvsroot/eclipse/e4/org.eclipse.e4.tools/bundles/org.eclipse .e4.tools.emf.ui
>
> Tom
>
> Am 12.01.11 15:23, schrieb Matthias Köster:
>> Hi,
>>
>> I'm using ObservableListTreeContentProvider to create a tree view for an
>> EMF based model. Everything works fine, I especially like the EMF edit
>> integration. Now I want to group my object eContents based on their
>> feature. So currently my tree looks like:
>>
>> Car
>> +Engine
>> +Tire
>> +Tire
>>
>> Engine belongs to the feature engine and both Tire objects belong to the
>> tires feature. I want to display them as:
>> Car
>> +engine
>> +Engine
>> +tires
>> +Tire
>> +Tire
>>
>> How can I achive sth. like that? Via a DelegatingListProperty? Does an
>> example exist for this use case?
>>
>> Regards,
>> Matthias
>
Previous Topic:TitleAreaDialog using databinding validation to disable the OK button
Next Topic:Only display one child of under a parent node in treeviewer
Goto Forum:
  


Current Time: Wed Oct 22 22:39:31 GMT 2014

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

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