Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to add code to all XXXEditPart's and XXXViewFactories at one place?
How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #47724] Thu, 14 September 2006 03:19 Go to next message
Eclipse UserFriend
Hi,

I want to overwrite handleNotificationEvent for all generated
XXXEditPart to listen for changes - but it's annoying and if I add new
component I’ll have to overwrite the same method again and again
the same is for XXXViewVactory - I have to modify createStyles to add
one more style.

I'm looking for a solution similar to EditPolicies where I use extension
point - org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders and in my
class to install edit policy to EditPart if EditPart is one of those I'm
interested. Is there any similar mechanism for handleNotificationEvent
and createStyles ?

Regards,
Trifonov
Re: How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #47854 is a reply to message #47724] Thu, 14 September 2006 06:07 Go to previous messageGo to next message
Eclipse UserFriend
Hello Trifonov,

You can try using dynamic templates.

-----------------
Alex Shatalin
Re: How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #47914 is a reply to message #47854] Thu, 14 September 2006 07:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

I know that feature (Although, I haven't use it and I don't know details
about it) but if you change something in templates in next version of
GMF I'll have to rewrite my templates

Alex Shatalin wrote:
> Hello Trifonov,
>
> You can try using dynamic templates.
>
> -----------------
> Alex Shatalin
>
>
Re: How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #48094 is a reply to message #47914] Thu, 14 September 2006 11:06 Go to previous messageGo to next message
Eclipse UserFriend
It depends on the level of template granularity.

If there's <jet include fail="silent"> in the very place you need change
in, you could place your extended code in the separate .jetinc file and
don't bother about merging templates in the future. Right now we don't
provide granularity finer than whole template, however, it doesn't mean we
won't if there's need (read: bugzilla)

Artem

"Trifonov" <ttrifonov@sbnd.net> wrote in message
news:eebd5k$c43$1@utils.eclipse.org...
> Hi Alex,
>
> I know that feature (Although, I haven't use it and I don't know details
> about it) but if you change something in templates in next version of GMF
> I'll have to rewrite my templates
>
> Alex Shatalin wrote:
>> Hello Trifonov,
>>
>> You can try using dynamic templates.
>>
>> -----------------
>> Alex Shatalin
>>
Re: How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #48531 is a reply to message #48094] Fri, 15 September 2006 02:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I've got the following hierarchy: AbstractWidget - is abstract class and
all concrete widgets extends it. I believe it will be very nice if I've
got generated AbstractWidgetEditpPart and AbstractWidgetViewFactory.
I'll be able to edit just the abstract classes and to get the
modification in my sub-classes easily. I made a note about that in the
treat where GMF 2.0 was discussed.

Artem Tikhomirov wrote:
> It depends on the level of template granularity.
>
> If there's <jet include fail="silent"> in the very place you need change
> in, you could place your extended code in the separate .jetinc file and
> don't bother about merging templates in the future. Right now we don't
> provide granularity finer than whole template, however, it doesn't mean we
> won't if there's need (read: bugzilla)
>
> Artem
>
> "Trifonov" <ttrifonov@sbnd.net> wrote in message
> news:eebd5k$c43$1@utils.eclipse.org...
>> Hi Alex,
>>
>> I know that feature (Although, I haven't use it and I don't know details
>> about it) but if you change something in templates in next version of GMF
>> I'll have to rewrite my templates
>>
>> Alex Shatalin wrote:
>>> Hello Trifonov,
>>>
>>> You can try using dynamic templates.
>>>
>>> -----------------
>>> Alex Shatalin
>>>
>
Re: How to add code to all XXXEditPart's and XXXViewFactories at one place? [message #48683 is a reply to message #47724] Fri, 15 September 2006 06:19 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

I guess these are quite generic requirements - plug in custom edit
policy to update edit part / view on changes in domain / notation models
and define custom style in gmfgraph model; we could support them in
tooling...

Maybe such enhancement requests should be added to bugzilla?

Trifonov wrote:
> Hi,
>
> I want to overwrite handleNotificationEvent for all generated
> XXXEditPart to listen for changes - but it's annoying and if I add new
> component I’ll have to overwrite the same method again and again
> the same is for XXXViewVactory - I have to modify createStyles to add
> one more style.
>
> I'm looking for a solution similar to EditPolicies where I use extension
> point - org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders and in my
> class to install edit policy to EditPart if EditPart is one of those I'm
> interested. Is there any similar mechanism for handleNotificationEvent
> and createStyles ?
>
> Regards,
> Trifonov
Previous Topic:Develop a tool similar to ACME
Next Topic:classes not being generated
Goto Forum:
  


Current Time: Sat Jul 12 15:42:17 EDT 2025

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

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

Back to the top