How to determine whether a resource is currently loading [message #130831] |
Mon, 10 November 2008 12:20 |
Eclipse User |
|
|
|
Originally posted by: nA.web.xy
Hi there,
I needed the functunality that everytime a element of class "A" is
instantiated, an element of class "B" is instantiated also. Therefore I
added an Adapter to the container of class "A" and everytime I get a
notification that an "A" element is added I create a "B" element.
However, everytime EMF reloads the. xml resource the "B" elements are
doubled. Any suggestions how I could achieve the above described
functionality without having these problems everytime the resource is
reloaded?
Thank You
Bastian
|
|
|
|
Re: How to determine whether a resource is currently loading [message #130861 is a reply to message #130848] |
Mon, 10 November 2008 13:23 |
Eclipse User |
|
|
|
Originally posted by: nA.web.xy
Oh,
sorry for screwing up with choosing the newsgroup.
Thanks anyway for your answer; I'll consider your proposals
Bastian
"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:gf9c1a$68j$4@build.eclipse.org...
> Bastian,
>
> This is an EMF question. Please use
> news://new.eclipse.org/eclipse.tools.emf for those.
>
> Comments below.
>
>
> Eclipse GMF wrote:
>> Hi there,
>>
>> I needed the functunality that everytime a element of class "A" is
>> instantiated, an element of class "B" is instantiated also. Therefore I
>> added an Adapter to the container of class "A" and everytime I get a
>> notification that an "A" element is added I create a "B" element.
>>
> This sounds like a bad approach.
>> However, everytime EMF reloads the. xml resource the "B" elements are
>> doubled.
> That's not surprising.
>> Any suggestions how I could achieve the above described functionality
>> without having these problems everytime the resource is reloaded?
>>
> I don't think your model should be doing this directly. Consider what
> happens when you use EcoreUtil.copy...
>
> I think you should be specializing the item providers to do this. THe
> collectNewChildDescriptors method creates instances of "A" and in there
> you can prepopulate that instance. I don't think GMF uses those. For GMF
> I think there are creation tools.
>> Thank You
>>
>> Bastian
>>
>>
|
|
|
Re: How to determine whether a resource is currently loading [message #620399 is a reply to message #130831] |
Mon, 10 November 2008 13:13 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Bastian,
This is an EMF question. Please use
news://new.eclipse.org/eclipse.tools.emf for those.
Comments below.
Eclipse GMF wrote:
> Hi there,
>
> I needed the functunality that everytime a element of class "A" is
> instantiated, an element of class "B" is instantiated also. Therefore I
> added an Adapter to the container of class "A" and everytime I get a
> notification that an "A" element is added I create a "B" element.
>
This sounds like a bad approach.
> However, everytime EMF reloads the. xml resource the "B" elements are
> doubled.
That's not surprising.
> Any suggestions how I could achieve the above described
> functionality without having these problems everytime the resource is
> reloaded?
>
I don't think your model should be doing this directly. Consider what
happens when you use EcoreUtil.copy...
I think you should be specializing the item providers to do this. THe
collectNewChildDescriptors method creates instances of "A" and in there
you can prepopulate that instance. I don't think GMF uses those. For
GMF I think there are creation tools.
> Thank You
>
> Bastian
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04250 seconds