Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » create actions for each EOperation semi-automatically in editor plugin
create actions for each EOperation semi-automatically in editor plugin [message #641812] Sun, 28 November 2010 11:21 Go to next message
J. Behrensen is currently offline J. BehrensenFriend
Messages: 1
Registered: November 2010
Junior Member
Hello!
I would like to have a menu entry for some of the declared EOperations of my model, so that I can execute these operations from each object's context menu.

At the moment I generate the model code, edit plugin and editor plugin and then modify the methods contributeToMenu and menuAboutToShow of the generated class MyModelActionBarContributor. The modified code searches for the active object and adds an action for each declared EOperation. The new action then again executes the operation when invoked by selecting the menu entry.

I assume that this is a standard procedure. Does the EMF editor plugin generator offer some automatic code generation to implement these actions and menu entries?

With best regards,
Jan
Re: create actions for each EOperation semi-automatically in editor plugin [message #641839 is a reply to message #641812] Sun, 28 November 2010 16:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010305010902060503060405
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Jan,

No we don't have something for that. In general operations take
arguments and those would need to be specified. This is bugzilla deals
with that more general case.
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=316588>

https://bugs.eclipse.org/bugs/show_bug.cgi?id=316588



J. Behrensen wrote:
> Hello!
> I would like to have a menu entry for some of the declared EOperations
> of my model, so that I can execute these operations from each object's
> context menu.
>
> At the moment I generate the model code, edit plugin and editor plugin
> and then modify the methods contributeToMenu and menuAboutToShow of
> the generated class MyModelActionBarContributor. The modified code
> searches for the active object and adds an action for each declared
> EOperation. The new action then again executes the operation when
> invoked by selecting the menu entry.
>
> I assume that this is a standard procedure. Does the EMF editor plugin
> generator offer some automatic code generation to implement these
> actions and menu entries?
>
> With best regards,
> Jan

--------------010305010902060503060405
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jan,<br>
<br>
No we don't have something for that.  In general operations take
arguments and those would need to be specified. This is bugzilla deals
with that more general case.<a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=316588"><br>
</a>
<blockquote><a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=316588">https://bugs.eclipse.org/bugs/show_bug.cgi?id=316588</a><br>
</blockquote>
<br>
<br>
J. Behrensen wrote:
<blockquote cite="mid:ictdn8$qki$1@news.eclipse.org" type="cite">Hello!
<br>
I would like to have a menu entry for some of the declared EOperations
of my model, so that I can execute these operations from each object's
context menu.
<br>
<br>
At the moment I generate the model code, edit plugin and editor plugin
and then modify the methods contributeToMenu and menuAboutToShow of the
generated class MyModelActionBarContributor. The modified code searches
for the active object and adds an action for each declared EOperation.
The new action then again executes the operation when invoked by
selecting the menu entry.
<br>
<br>
I assume that this is a standard procedure. Does the EMF editor plugin
generator offer some automatic code generation to implement these
actions and menu entries?
<br>
<br>
With best regards,
<br>
Jan
<br>
</blockquote>
</body>
</html>

--------------010305010902060503060405--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:model attributes for each pair of class A and class B
Next Topic:How to disable copy, cut, paste, delete menu items for elements with specific property
Goto Forum:
  


Current Time: Thu Mar 28 08:21:51 GMT 2024

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

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

Back to the top