Skip to main content


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 KaracaFriend
Messages: 854
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 MerksFriend
Messages: 33137
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?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Copy one subclass instance to another
Next Topic:Why does EAnnoptation initialization code not set the annotation contents ?
Goto Forum:
  


Current Time: Fri Apr 19 20:48:22 GMT 2024

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

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

Back to the top