Home » Modeling » EMF » Custom code after initialization (Short question)
| | | | | | | |
Re: Custom code after initialization (Short question) [message #415984 is a reply to message #415983] |
Tue, 15 January 2008 02:29 |
Stefan Kuhn Messages: 355 Registered: July 2009 |
Senior Member |
|
|
hi ed,
normally you can add additional behavior, e.g. initializing an element
with an EditHelper(Advice). Since they are in reality called by the
parent element, this is not possible for the root element right now.
-stefan
P.S. I've fixed this genmodel bug (id=215282) ... 3 lines of code :(
Ed Merks wrote:
> Stefan,
>
> I'm not sure I understand the issue very well, but it seems a reasonable
> thing...
>
>
> SKuhn wrote:
>> hi ed,
>>
>> maybe it would be worth it executing the EditHelper for the
>> root/canvas element?
>>
>> should I file a feature request?
>>
>> -stefan
>>
>> Ed Merks wrote:
>>> Tomas,
>>>
>>> This sounds like purely a GMF question so I've added the GMF
>>> newsgroup to the "to" list of the reply so it can be answered there.
>>>
>>>
>>> Tomas Zijdemans wrote:
>>>> Hi all :)
>>>>
>>>> I'm trying to execute some model specific code after a diagram has
>>>> been initialized (add some elements that always should be present at
>>>> startup). I've experimented with the constructor of the diagram
>>>> element, but this constructor gets called many times at startup, and
>>>> my code should only be run once per diagram. Where should I rather
>>>> put my code?
>>>>
>>>>
>>>> Best Regards,
>>>>
>>>> Tomas Zijdemans
|
|
|
Re: Custom code after initialization (Short question) [message #415987 is a reply to message #415984] |
Tue, 15 January 2008 11:37 |
Ed Merks Messages: 33138 Registered: July 2009 |
Senior Member |
|
|
Stefan,
I see. Allowing an EditHelper for the root would make really good sense
then.
I've commented on the bug that the option should to serialize with a
schema location, which is essential for supporting purely dynamic models
as the document suggests is supported, should be added at the time the
resource is created so anyone saving the resource will do so correctly.
It also seems to me that this decorator approach should allow a static
model to be used and that in that case, the generated item providers
could be used in the properties view (because item providers are
registered and could be discovered as needed).
SKuhn wrote:
> hi ed,
>
> normally you can add additional behavior, e.g. initializing an element
> with an EditHelper(Advice). Since they are in reality called by the
> parent element, this is not possible for the root element right now.
>
> -stefan
>
> P.S. I've fixed this genmodel bug (id=215282) ... 3 lines of code :(
>
> Ed Merks wrote:
>> Stefan,
>>
>> I'm not sure I understand the issue very well, but it seems a
>> reasonable thing...
>>
>>
>> SKuhn wrote:
>>> hi ed,
>>>
>>> maybe it would be worth it executing the EditHelper for the
>>> root/canvas element?
>>>
>>> should I file a feature request?
>>>
>>> -stefan
>>>
>>> Ed Merks wrote:
>>>> Tomas,
>>>>
>>>> This sounds like purely a GMF question so I've added the GMF
>>>> newsgroup to the "to" list of the reply so it can be answered there.
>>>>
>>>>
>>>> Tomas Zijdemans wrote:
>>>>> Hi all :)
>>>>>
>>>>> I'm trying to execute some model specific code after a diagram has
>>>>> been initialized (add some elements that always should be present
>>>>> at startup). I've experimented with the constructor of the diagram
>>>>> element, but this constructor gets called many times at startup,
>>>>> and my code should only be run once per diagram. Where should I
>>>>> rather put my code?
>>>>>
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Tomas Zijdemans
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Custom code after initialization (Short question) [message #415992 is a reply to message #415987] |
Tue, 15 January 2008 14:33 |
Stefan Kuhn Messages: 355 Registered: July 2009 |
Senior Member |
|
|
vote for:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215344
-stefan
Ed Merks wrote:
> Stefan,
>
> I see. Allowing an EditHelper for the root would make really good sense
> then.
>
> I've commented on the bug that the option should to serialize with a
> schema location, which is essential for supporting purely dynamic models
> as the document suggests is supported, should be added at the time the
> resource is created so anyone saving the resource will do so correctly.
> It also seems to me that this decorator approach should allow a static
> model to be used and that in that case, the generated item providers
> could be used in the properties view (because item providers are
> registered and could be discovered as needed).
>
>
> SKuhn wrote:
>> hi ed,
>>
>> normally you can add additional behavior, e.g. initializing an element
>> with an EditHelper(Advice). Since they are in reality called by the
>> parent element, this is not possible for the root element right now.
>>
>> -stefan
>>
>> P.S. I've fixed this genmodel bug (id=215282) ... 3 lines of code :(
>>
>> Ed Merks wrote:
>>> Stefan,
>>>
>>> I'm not sure I understand the issue very well, but it seems a
>>> reasonable thing...
>>>
>>>
>>> SKuhn wrote:
>>>> hi ed,
>>>>
>>>> maybe it would be worth it executing the EditHelper for the
>>>> root/canvas element?
>>>>
>>>> should I file a feature request?
>>>>
>>>> -stefan
>>>>
>>>> Ed Merks wrote:
>>>>> Tomas,
>>>>>
>>>>> This sounds like purely a GMF question so I've added the GMF
>>>>> newsgroup to the "to" list of the reply so it can be answered there.
>>>>>
>>>>>
>>>>> Tomas Zijdemans wrote:
>>>>>> Hi all :)
>>>>>>
>>>>>> I'm trying to execute some model specific code after a diagram has
>>>>>> been initialized (add some elements that always should be present
>>>>>> at startup). I've experimented with the constructor of the diagram
>>>>>> element, but this constructor gets called many times at startup,
>>>>>> and my code should only be run once per diagram. Where should I
>>>>>> rather put my code?
>>>>>>
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Tomas Zijdemans
|
|
| | |
Goto Forum:
Current Time: Sat Apr 20 07:04:32 GMT 2024
Powered by FUDForum. Page generated in 0.03925 seconds
|