|
|
Re: Hook for creation and destruction of EObject [message #657913 is a reply to message #656750] |
Fri, 04 March 2011 15:14 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Marco,
sorry, your message somehow slipped through the net.
1) Have a look at IAstFactory#create . The instance is not fully
initialized, though. AbstractCleaningLinker#beforeModelLinked should be
a better match for your usecase.
2) Please register a EContentAdapter in the resource to get such a
notification.
However, I'd recommend to implement something along those lines:
AbstractCleaningLinker#beforeModelLinker:
remove any dynamically created instance from your model.
DefaultLinkingService#getLinkedObjects(EObject, EReference, INode):
create instances dynamically if the returned list is empty.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 28.02.11 13:49, schrieb Marco:
> Hi,
>
> According to Sven's proposal I create additional EObject during linking.
> But due to limitation with forward/cyclic references this is too late.
>
> It would be perfect to create the additional EObjects after normal
> creation of an EObject as a result of parsing.
>
> 1. Is there a hook called which is called for each EObject identified by
> the parser before linking?
>
> 2. Is there a hook which is called an Object is removed from source?
>
> Thanks,
> Marco
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03221 seconds