Skip to main content


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 12:11 Go to next message
becks m is currently offline becks mFriend
Messages: 59
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 12: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 12:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889655 is a reply to message #889643] Tue, 19 June 2012 12:56 Go to previous messageGo to next message
becks m is currently offline becks mFriend
Messages: 59
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 13:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How can I set multiple root to treeviewer using emf adapterfactoryContentProvider [message #889702 is a reply to message #889683] Tue, 19 June 2012 13:44 Go to previous message
becks m is currently offline becks mFriend
Messages: 59
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 13: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 Mar 28 12:16:57 GMT 2024

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

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

Back to the top