Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How can I set multiple root to treeviewer using emf adapterfactoryContentProvider
How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889615] Tue, 19 June 2012 08:11 Go to next message
becks m is currently offline becks m
Messages: 58
Registered: June 2012
Member
Hi guys,

I want to set multiple roots for my treeviewer.

My program uses AdapterFactoryContentProvider as the tree viewer content provider but I was using single root.

Now when I wanted to add multiple root I knew that I should use ArrayContentProvider

is there something like this in EMF or I should adapt all previous code to the jface ArrayContentProvider ?



Thanks

[Updated on: Tue, 19 June 2012 08:14]

Report message to a moderator

Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889643 is a reply to message #889615] Tue, 19 June 2012 08:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25918
Registered: July 2009
Senior Member
You can create an org.eclipse.emf.edit.provider.ItemProvider and use
that as input to the view. In the constructor you can specify the
collection of objects you want as roots displayed in the tree view.

On 19/06/2012 8:11 AM, becks m wrote:
> Hi guys,
>
> I want to set multiple roots for my treeviewer.
>
> My program uses AdapterFactoryContentProvider as the tree viewer
> content provider but I was using single root.
>
> Now when I wanted to add multiple root I knew that I should use
> ArrayContentProvider
>
> is there something like this in EMF I should adapt all previous code
> to the jface ArrayContentProvider ?
>
>
>
> Thanks
Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889655 is a reply to message #889643] Tue, 19 June 2012 08:56 Go to previous messageGo to next message
becks m is currently offline becks m
Messages: 58
Registered: June 2012
Member
Ed Merks wrote on Tue, 19 June 2012 08:41
You can create an org.eclipse.emf.edit.provider.ItemProvider and use
that as input to the view. In the constructor you can specify the
collection of objects you want as roots displayed in the tree view.

On 19/06/2012 8:11 AM, becks m wrote:
> Hi guys,
>
> I want to set multiple roots for my treeviewer.
>
> My program uses AdapterFactoryContentProvider as the tree viewer
> content provider but I was using single root.
>
> Now when I wanted to add multiple root I knew that I should use
> ArrayContentProvider
>
> is there something like this in EMF I should adapt all previous code
> to the jface ArrayContentProvider ?
>
>
>
> Thanks




Thanks Ed,
I already have org.eclipse.emf.edit.provider.ItemProvider created for all my classes and that was used by adapterfactorycontentprovider.


In which constructor you mean ? can you please clarify this point .


Thanks,
becks
Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889683 is a reply to message #889655] Tue, 19 June 2012 09:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25918
Registered: July 2009
Senior Member
Are you perhaps mixing up ItemProviderAdapter, the base class for all
your generated item providers, with ItemProvider? I'm pretty sure
ItemProvider(Collection) will provide what you need.


On 19/06/2012 8:56 AM, becks m wrote:
> Ed Merks wrote on Tue, 19 June 2012 08:41
>> You can create an org.eclipse.emf.edit.provider.ItemProvider and use
>> that as input to the view. In the constructor you can specify the
>> collection of objects you want as roots displayed in the tree view.
>>
>> On 19/06/2012 8:11 AM, becks m wrote:
>> > Hi guys,
>> >
>> > I want to set multiple roots for my treeviewer.
>> >
>> > My program uses AdapterFactoryContentProvider as the tree viewer >
>> content provider but I was using single root.
>> >
>> > Now when I wanted to add multiple root I knew that I should use >
>> ArrayContentProvider
>> >
>> > is there something like this in EMF I should adapt all previous
>> code > to the jface ArrayContentProvider ?
>> >
>> >
>> >
>> > Thanks
>
>
>
>
> Thanks Ed,
> I already have org.eclipse.emf.edit.provider.ItemProvider created for
> all my classes and that was used by adapterfactorycontentprovider.
>
>
> In which constructor you mean ? can you please clarify this point .
>
>
> Thanks,
> becks
Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889702 is a reply to message #889683] Tue, 19 June 2012 09:44 Go to previous message
becks m is currently offline becks m
Messages: 58
Registered: June 2012
Member
It seems that I was mixing them up.
Now, I got your point, and I'll give it a try and get back if there is something else


Thanks a lot Ed.


Cheers,
becks

[Updated on: Tue, 19 June 2012 09:45]

Report message to a moderator

Previous Topic:[EMF] Base Ecore and extending one.
Next Topic:Validation via Diagnostician multiple times
Goto Forum:
  


Current Time: Thu Jul 24 13:44:46 EDT 2014

Powered by FUDForum. Page generated in 0.02791 seconds