Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » using ecore-model in eclipse view
using ecore-model in eclipse view [message #417693] Fri, 21 March 2008 13:17 Go to next message
Eclipse UserFriend
Originally posted by: karin.schellner.lixto.com

Hi,

I am failing to use my ecore-model with an Eclipse View. I am creating
instances of my model and I am using code like this to attach the generated
ItemProviders to the Treeviewer I have embedded in the View:

adapterFactory = new
ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Reg istry.INSTANCE);
adapterFactory.addAdapterFactory(new
MyEcoreModelItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new
ReflectiveItemProviderAdapterFactory());
treeViewer.setContentProvider(new
AdapterFactoryContentProvider(adapterFactory));
treeviewer.setLabelProvider(new
AdapterFactoryLabelProvider(adapterFactory));

but this seems somehow not to be the proper code (the View stays empty and
the ItemProvider classes never get called).
Does anyone know how to do this properly? Thanks for any help!

cheers,
karin.
Re: using ecore-model in eclipse view [message #417699 is a reply to message #417693] Fri, 21 March 2008 15:38 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Karin,

The view is populated by the content provider, so if the view is
completely blank, it's the lack of good behavior from the content
provider that would be at fault.


Karin Schellner wrote:
> Hi,
>
> I am failing to use my ecore-model with an Eclipse View. I am creating
> instances of my model and I am using code like this to attach the generated
> ItemProviders to the Treeviewer I have embedded in the View:
>
> adapterFactory = new
> ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Reg istry.INSTANCE);
> adapterFactory.addAdapterFactory(new
> MyEcoreModelItemProviderAdapterFactory());
> adapterFactory.addAdapterFactory(new
> ReflectiveItemProviderAdapterFactory());
> treeViewer.setContentProvider(new
> AdapterFactoryContentProvider(adapterFactory));
> treeviewer.setLabelProvider(new
> AdapterFactoryLabelProvider(adapterFactory));
>
> but this seems somehow not to be the proper code (the View stays empty and
> the ItemProvider classes never get called).
> Does anyone know how to do this properly? Thanks for any help!
>
> cheers,
> karin.
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem with EFeatureMapEntry
Next Topic:Re: how to set Stateful item provider adapters (NOT singleton)
Goto Forum:
  


Current Time: Thu Mar 28 09:22:02 GMT 2024

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

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

Back to the top