Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Over riding an existing action
Over riding an existing action [message #144173] Wed, 25 July 2007 15:58 Go to next message
Eclipse UserFriend
Originally posted by: james.willans.xactium.com

I want to extend the condition by which a DeleteFromModelAction calculates
it enablement. What is the best way of doing this?

The method I have tried is to create a new Action which extends
DeleteFromModelAction with a new enablement calculation. I created an
extension of new DiagramContributionItemProvider which overrides
createAction to create the extension to DeleteFromModelAction rather than
the original. This was then declared as the contributionItemProvider in
the plugin.xml of the diagram plugin. However this does not seem to force
the diagram to use the new DiagramContributionItemProvider rather than the
original?

Thanks,

James
Re: Over riding an existing action [message #144311 is a reply to message #144173] Wed, 25 July 2007 20:53 Go to previous message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
James,

If you think there is a bug with the
DeleteFromModelAction.calculateEnabled() you could add to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165370.

To fix this, you will have to remove this DeleteFromModelAction and
contribute your own that does exactly what you want. However, I thought
the generated code was already doing this? Search for the following in
your XML:
<popupPredefinedItem id="deleteFromModelAction" remove="true"/>

- Cherie


James Willans wrote:
> I want to extend the condition by which a DeleteFromModelAction
> calculates it enablement. What is the best way of doing this?
> The method I have tried is to create a new Action which extends
> DeleteFromModelAction with a new enablement calculation. I created an
> extension of new DiagramContributionItemProvider which overrides
> createAction to create the extension to DeleteFromModelAction rather
> than the original. This was then declared as the
> contributionItemProvider in the plugin.xml of the diagram plugin.
> However this does not seem to force the diagram to use the new
> DiagramContributionItemProvider rather than the original?
>
> Thanks,
>
> James
>
Previous Topic:Change transparency of highlight rectangle on Outline view
Next Topic:Dragging of external Label creates a new View
Goto Forum:
  


Current Time: Fri Aug 16 16:10:18 GMT 2024

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

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

Back to the top