Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating a MenuAction for an EOperation
Creating a MenuAction for an EOperation [message #60655] Wed, 11 October 2006 08:53 Go to next message
Eclipse UserFriend
Dear GMF-Developers and -Users,

I want to add a MenuAction to the ContextMenu of one of my Nodes. This
MenuAction should call a EOperation defined in my Ecore-Model. How can I
achieve this?

Is there a way to map a Menu Action (from the Tooldef) onto an EOperation?

Or is the only way to add such an Menu Action by following the
"customizing" example in the GMF-Tutorial? I got stuck implementing the
Action as I don't know how to call the method of the ecore-modelelement
once I determined the selected EditPart. Can you help me with this
please, if necessary?

Thank you very much,
Re: Creating a MenuAction for an EOperation [message #60656 is a reply to message #60655] Wed, 11 October 2006 09:41 Go to previous messageGo to next message
Eclipse UserFriend
Ok, after a mug of coffee I found out that following statement did it:

selectedElement.getPrimaryView().getElement();

But the questions remains: Is there a way to map Menu Action on EOperations?

Greetings,
Alexander

Alexander Dotor schrieb:
> Dear GMF-Developers and -Users,
>
> I want to add a MenuAction to the ContextMenu of one of my Nodes. This
> MenuAction should call a EOperation defined in my Ecore-Model. How can I
> achieve this?
>
> Is there a way to map a Menu Action (from the Tooldef) onto an EOperation?
>
> Or is the only way to add such an Menu Action by following the
> "customizing" example in the GMF-Tutorial? I got stuck implementing the
> Action as I don't know how to call the method of the ecore-modelelement
> once I determined the selected EditPart. Can you help me with this
> please, if necessary?
>
> Thank you very much,
Re: Creating a MenuAction for an EOperation [message #60948 is a reply to message #60656] Wed, 11 October 2006 12:48 Go to previous message
Eclipse UserFriend
>> Is there a way to map a Menu Action (from the Tooldef) onto an
>> EOperation?

Menu Action from gmftool is of no help because it's not yet supported by the
generator.

What's wrong with context menu actions contributed with objectContribution?

Artem

"Alexander Dotor" <alexander.dotor@uni-bayreuth.de> wrote in message
news:egisas$tkq$1@utils.eclipse.org...
> Ok, after a mug of coffee I found out that following statement did it:
>
> selectedElement.getPrimaryView().getElement();
>
> But the questions remains: Is there a way to map Menu Action on
> EOperations?
>
> Greetings,
> Alexander
>
> Alexander Dotor schrieb:
>> Dear GMF-Developers and -Users,
>>
>> I want to add a MenuAction to the ContextMenu of one of my Nodes. This
>> MenuAction should call a EOperation defined in my Ecore-Model. How can I
>> achieve this?
>>
>> Is there a way to map a Menu Action (from the Tooldef) onto an
>> EOperation?
>>
>> Or is the only way to add such an Menu Action by following the
>> "customizing" example in the GMF-Tutorial? I got stuck implementing the
>> Action as I don't know how to call the method of the ecore-modelelement
>> once I determined the selected EditPart. Can you help me with this
>> please, if necessary?
>>
>> Thank you very much,
Previous Topic:No parser is registered for the "OCL" language
Next Topic:Custom Figure Compartments with child elements
Goto Forum:
  


Current Time: Sun Jun 22 20:18:58 EDT 2025

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

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

Back to the top