|
|
|
Re: Derived Property [message #1706251 is a reply to message #1706177] |
Tue, 25 August 2015 10:12 |
Koen Staal Messages: 70 Registered: October 2014 |
Member |
|
|
I have looked into the possible solutions, and this post discourages adjusting the factory. In the itemprovider however i cant figure in which method i can add the creation of new Eobject. collectNewChildDescriptors seems to never get called.
Any suggestion what method i should adjust?
[Updated on: Tue, 25 August 2015 11:39] Report message to a moderator
|
|
|
Re: Derived Property [message #1706320 is a reply to message #1706251] |
Tue, 25 August 2015 16:19 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Koen,
Comments below.
On 25/08/2015 12:12 PM, Koen Staal wrote:
> I have looked into the possible solutions, and this post
> http://eclipsesource.com/blogs/2013/03/13/emf-dos-and-don%C2%B4ts-4/
> discourages adjusting the factory.
It discourages changing what the existing methods in the factory do. In
general you should not initial objects beyond the normal generated
state. So no calling setters in the constructors or in the factory
methods, no calling setters in any getter methods, and so on. There's
nothing to argue against adding additional convenient methods to the
factory to do whatever you like. Just don't disrupt the default behavior.
> In the itemprovider however i cant figure in which method i can add
> the creation of new Eobject. collectNewChildDescriptors seems to never
> get called.
You'll see methods in the container object's item providers for creating
the contained types of children. There you can create any kind of
initialized child that you like.
>
> Any suggestion what method i should adjust?
Here's how I would find this out if I didn't know how a framework
worked. I'd set a breakpoint in the constructor of the object and then
I'd go to the editor and create an instance of it. Then I could see
how and where that instance is being created...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03184 seconds