Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to add to an existing edit policy?
how to add to an existing edit policy? [message #224637] Tue, 17 October 2006 20:17 Go to next message
Eclipse UserFriend
Originally posted by: liam.morley.baesystems.com

I'm writing a modular editor with the GMF where different plugins can add
functionality to the same editor. When a plugin adds something to the
palette, it needs to add an EditPolicy as well so that the plugin can
contribute the correct commands for the edition. I was using
EditPart.installEditPolicy() to add another policy with SEMANTIC_ROLE, but I
realize now that that erases the existing policy with the same key. Is there
a way to have multiple policies with the same key, or is there currently a
way to add functionality to an existing policy?

Thanks,
Liam Morley
Re: how to add to an existing edit policy? [message #224711 is a reply to message #224637] Wed, 18 October 2006 16:05 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-17二的 16:17 -0400,Liam Morley写道:
> I'm writing a modular editor with the GMF where different plugins can add
> functionality to the same editor. When a plugin adds something to the
> palette, it needs to add an EditPolicy as well so that the plugin can
> contribute the correct commands for the edition. I was using
> EditPart.installEditPolicy() to add another policy with SEMANTIC_ROLE, but I
> realize now that that erases the existing policy with the same key. Is there
> a way to have multiple policies with the same key, or is there currently a
> way to add functionality to an existing policy?
>
> Thanks,
> Liam Morley
>
>
Hi,
Each existing Role with EditPolicy known about some Request, your Role
too. Now the same Role want capture difference Request, so it is a
choice that appling a strategy pattern for the special EditPolicy.

Regards

Qinxian.
Re: how to add to an existing edit policy? [message #224725 is a reply to message #224711] Wed, 18 October 2006 19:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: liam.morley.baesystems.com

I'm not sure if I follow- I want to be able to apply both policies to the
same role simultaneously. Are you saying to have one policy per role, but
have my policy function as a strategy? I think what you're saying is that
this functionality does not exist natively in the GEF, but I can implement
it on my own. Is that true?

Liam


"Xiang Qinxian" <fyaoxy@gmail.com> wrote in message
news:1161187543.2964.14.camel@qinxian.xiang...
? 2006-10-17?? 16:17 -0400,Liam Morley??:
> I'm writing a modular editor with the GMF where different plugins can add
> functionality to the same editor. When a plugin adds something to the
> palette, it needs to add an EditPolicy as well so that the plugin can
> contribute the correct commands for the edition. I was using
> EditPart.installEditPolicy() to add another policy with SEMANTIC_ROLE, but
> I
> realize now that that erases the existing policy with the same key. Is
> there
> a way to have multiple policies with the same key, or is there currently a
> way to add functionality to an existing policy?
>
> Thanks,
> Liam Morley
>
>
Hi,
Each existing Role with EditPolicy known about some Request, your Role
too. Now the same Role want capture difference Request, so it is a
choice that appling a strategy pattern for the special EditPolicy.

Regards

Qinxian.
Re: how to add to an existing edit policy? [message #224772 is a reply to message #224725] Wed, 18 October 2006 20:43 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

You should ask on the GMF newsgroup about the best way to do this. There's
only one editpolicy per role. But you can install several different
editpolicies that can handle the same request type.

"Liam Morley" <liam.morley@baesystems.com> wrote in message
news:eh5uue$643$1@utils.eclipse.org...
> I'm not sure if I follow- I want to be able to apply both policies to the
> same role simultaneously. Are you saying to have one policy per role, but
> have my policy function as a strategy? I think what you're saying is that
> this functionality does not exist natively in the GEF, but I can implement
> it on my own. Is that true?
>
> Liam
>
>
> "Xiang Qinxian" <fyaoxy@gmail.com> wrote in message
> news:1161187543.2964.14.camel@qinxian.xiang...
> ? 2006-10-17?? 16:17 -0400,Liam Morley??:
>> I'm writing a modular editor with the GMF where different plugins can add
>> functionality to the same editor. When a plugin adds something to the
>> palette, it needs to add an EditPolicy as well so that the plugin can
>> contribute the correct commands for the edition. I was using
>> EditPart.installEditPolicy() to add another policy with SEMANTIC_ROLE,
>> but I
>> realize now that that erases the existing policy with the same key. Is
>> there
>> a way to have multiple policies with the same key, or is there currently
>> a
>> way to add functionality to an existing policy?
>>
>> Thanks,
>> Liam Morley
>>
>>
> Hi,
> Each existing Role with EditPolicy known about some Request, your Role
> too. Now the same Role want capture difference Request, so it is a
> choice that appling a strategy pattern for the special EditPolicy.
>
> Regards
>
> Qinxian.
>
>
>
Previous Topic:Zooming with no blur
Next Topic:RCP and GEF examples
Goto Forum:
  


Current Time: Tue Apr 16 11:54:15 GMT 2024

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

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

Back to the top