Get ElementType from containing feature and target EClass [message #479187] |
Mon, 10 August 2009 07:56 |
|
Hi all,
AFAIK, it is necessary to specify the ELementType (for example XXXElementTypes.NODE_2006) when one wants to programmatically create a node in the diagram. I'd like to find the way to deduce this ElementType from the EClass of the object I wish to create and the containing feature that should contain it. Some mapping model introspection at runtime would allow to do this kind of thing, but I am not aware of something like that existing...
Do you have any advices?
Mickael
|
|
|
|
Re: Get ElementType from containing feature and target EClass [message #481739 is a reply to message #479187] |
Mon, 24 August 2009 07:39 |
|
Hello,
For those who are interested about a way to guess (before its is created) a node ElementType from its EClass and the EObject that is intended to contain it, here is an useful method that can be used: ModelingAssistantService.getTypeForPopupBar. It returns the list of ElementType that can be used on an object to create a child.
Hope that may help someone else one day...
Mickael
Mickael Istria a écrit :
> Hi all,
>
> AFAIK, it is necessary to specify the ELementType (for example
> XXXElementTypes.NODE_2006) when one wants to programmatically create a
> node in the diagram. I'd like to find the way to deduce this ElementType
> from the EClass of the object I wish to create and the containing
> feature that should contain it. Some mapping model introspection at
> runtime would allow to do this kind of thing, but I am not aware of
> something like that existing...
>
> Do you have any advices?
>
> Mickael
|
|
|
|
Powered by
FUDForum. Page generated in 0.02806 seconds