Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Add actions/actionsets to the context-menu?
Add actions/actionsets to the context-menu? [message #965867] Wed, 31 October 2012 15:13 Go to next message
Hernan Gonzalez is currently offline Hernan GonzalezFriend
Messages: 188
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
I'd wish to customize the editor context menu, adding some "external" (i.e. non related to Graphiti-GEF) actions. Specifically, I have some lauch actions (Run As / Debug As), that can currently by called from the main menu (and the contextual menu on the resource, in the Project Explorer), but I'm not sure how to add those items (either programatically, in my DiagramEditorContextMenuProvider or declaratively in plugin.xml) to the context menu.

Any pointers?
Re: Add actions/actionsets to the context-menu? [message #968070 is a reply to message #965867] Fri, 02 November 2012 07:10 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hernan,

ususally Graphiti allows to add features to that context menu. So you could
either try to wrap these actions in custom features or if that is not
possible add them directly within the editor.
DiagramEditor.createContextMenuProvider can be used to create a custom
context menu provider and could e.g. return a subclass of
DiagramEditorContextMenuProvider that additionally adds your stuff to the
context menu.

Michael
Re: Add actions/actionsets to the context-menu? [message #1005255 is a reply to message #968070] Thu, 24 January 2013 18:17 Go to previous messageGo to next message
Hernan Gonzalez is currently offline Hernan GonzalezFriend
Messages: 188
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
Am I wrong in guessing that Graphiti is in this respect little cooperative and disruptive of the Eclipse-RCP usage? By building the context-menu in such uncooperative away (programatically, and in isolation), the editor loses (irrevocably?) lots of standard functionality that the user expects in a Eclipse-RCP product. For example: I have a product that works similarly to Eclipse IDE, with a "project explorer" with its resources, and text editors that work together with my Graphiti editor; the user expects that when right-click any resource in the Project Explorer, in the Text Editor or in the Graphiti Editor, the contextual menu will allow some actions that are common to all them (and which are provided by other plugins unrelated to the editor): for example, the "Run/Debug" action set, the "Team -> Compare with".

I'm not an expert at Eclipse-RCP best practices, but this smells bad to me.
The Graphiti editor should not assume that all the actions that are to be executed via its contextual menu are editor actions.

[Updated on: Thu, 24 January 2013 18:44]

Report message to a moderator

Re: Add actions/actionsets to the context-menu? [message #1005452 is a reply to message #1005255] Fri, 25 January 2013 13:54 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hernan,

what you write is true, those pieces of functionality will not appear in the
diagram by default, but I'm not sure if it would be good idea to have all
functionality automatically available in the diagram as well. I know some
examples in tools where this is explicitly not wanted, as the diagram shows
a reduced "view of the world" or does not want to enable everything that's
possible somewhere else.

Michael
Re: Add actions/actionsets to the context-menu? [message #1006584 is a reply to message #1005452] Thu, 31 January 2013 22:59 Go to previous messageGo to next message
Hernan Gonzalez is currently offline Hernan GonzalezFriend
Messages: 188
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
Michael Wenz wrote on Fri, 25 January 2013 10:54
I know some
examples in tools where this is explicitly not wanted


Well, my obvious reply to that would be that I know some examples where that is explicitly wanted Razz

And that I have no idea of how to recover that functionality - it that's possible.
Re: Add actions/actionsets to the context-menu? [message #1006685 is a reply to message #1006584] Fri, 01 February 2013 12:34 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hernan,

if you like to see that in the framework, please open an enhancement
bugzilla.

Michael
Previous Topic:[0.9.1] Using Graphiti with external editing domain causes problem at clean up
Next Topic:text.setForeground(...) don't work as expected
Goto Forum:
  


Current Time: Fri Apr 19 01:52:42 GMT 2024

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

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

Back to the top