[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.emf] Re: Question about setting resource and container
|
Tomas,
Thanks for point out an EMF bug.
The container will be set before attached() is called. Please open
a bugzilla defect. We will fix in EMF 1.1.1. release.
Regards,
Shu
"Tomas Malik" <malikt@xxxxxxxxxxxxx> wrote in message
news:bi5a2j$akg$1@xxxxxxxxxxxxxx
>
> Hello,
>
> I implemented subclass of XMIResourceImpl that sets ID for every EObject
in
> it based on containers names (e.g. container1.container2.Element) and
> implemented it into method setID(EObject eObject, String id).
>
> But when adding new element to container (which results in adding it to
> resource as well f ollowing steps occur:
>
> 1. create element E
> 2. add it to container C (e.g. E.setContainer(C))
> 3. method setting container calls method eBasicSetContainer
(E.eContainer()
> returns C)
> 4. method eBasicSetContainer (implementation in EObjectImpl ) calls
> newResource.attached(this) at this point E.eContainer() returns null
> 5. method attached() calls, among other methods, setID()
> 6. eBasicSetContainer method ends and again E.eContainer() returns C
>
> My questions are:
> Is this behaviour necessary that when adding to resource there is no
> container set and then it is being set back?
> Is there better place to set ID to EObject in Resource? a.k.a. Am I
missing
> here something ? :)
>
>
> Thaks in advance for your help,
>
> Tom
>
>
> I am using EMF 1.0.2
> For specific reasons, which would take quite a time to explain, I cannot
use
> URIfragment based referencing
>
>
>