Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Find ItemPropertyDescriptors by EClass instead of concrete instance
Find ItemPropertyDescriptors by EClass instead of concrete instance [message #899807] Thu, 02 August 2012 12:14 Go to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 741
Registered: July 2009
Senior Member
Is there a way to get an all IItemPropertyDescriptors by its EClass instead of providing a concrete instance of that type?

E.g.

I have the type MyType for which the gen model will generate a MyTypeItemProvider.
If I want to get all IItemPropertyDescriptors, I have to do it this way:

AdapterFactoryItemDelegator afid = new AdapterFactoryItemDelegator(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));

MyType obj = MyModelFactory.eInstance.createMyType();
List<IItemPropertyDescriptor> desc = afid.getPropertyDescriptors(obj);


If I just provide the EClass to the getPropertyDescriptors(), then I will get the EClassItemProvider of ecore's edit model...

Any hints?
Re: Find ItemPropertyDescriptors by EClass instead of concrete instance [message #899893 is a reply to message #899807] Thu, 02 August 2012 17:26 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26015
Registered: July 2009
Senior Member
Erdal,

Comments below.

On 02/08/2012 2:14 PM, Erdal Karaca wrote:
> Is there a way to get an all IItemPropertyDescriptors by its EClass
> instead of providing a concrete instance of that type?
Not really.
>
> E.g.
>
> I have the type MyType for which the gen model will generate a
> MyTypeItemProvider.
> If I want to get all IItemPropertyDescriptors, I have to do it this way:
>
> AdapterFactoryItemDelegator afid = new AdapterFactoryItemDelegator(new
> ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
>
> MyType obj = MyModelFactory.eInstance.createMyType();
> List<IItemPropertyDescriptor> desc = afid.getPropertyDescriptors(obj);
>
> If I just provide the EClass to the getPropertyDescriptors(), then I
> will get the EClassItemProvider of ecore's edit model...
That's all there is available.
>
> Any hints?
Previous Topic:Copy one subclass instance to another
Next Topic:Why does EAnnoptation initialization code not set the annotation contents ?
Goto Forum:
  


Current Time: Wed Sep 03 07:20:59 GMT 2014

Powered by FUDForum. Page generated in 0.02032 seconds