Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to determine whether a resource is currently loading
How to determine whether a resource is currently loading [message #130831] Mon, 10 November 2008 12:20 Go to next message
Eclipse UserFriend
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 #130848 is a reply to message #130831] Mon, 10 November 2008 13:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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/
Re: How to determine whether a resource is currently loading [message #130861 is a reply to message #130848] Mon, 10 November 2008 13:23 Go to previous message
Eclipse UserFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Re: How to determine whether a resource is currently loading [message #620400 is a reply to message #130848] Mon, 10 November 2008 13:23 Go to previous message
Bastian is currently offline BastianFriend
Messages: 1
Registered: July 2009
Junior Member
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
>>
>>
Previous Topic:How to determine whether a resource is currently loading
Next Topic:Suggestions for EqualityHelper
Goto Forum:
  


Current Time: Fri Apr 26 15:14:27 GMT 2024

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

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

Back to the top