Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Over riding an existing action
Over riding an existing action [message #144173] Wed, 25 July 2007 11: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 16:53 Go to previous message
Eclipse UserFriend
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: Wed Apr 30 03:02:13 EDT 2025

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

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

Back to the top