Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » View Menu: Grid and SnapToGeometry entries
View Menu: Grid and SnapToGeometry entries [message #1337261] Tue, 06 May 2014 19:58 Go to next message
Hernan Gonzalez is currently offline Hernan GonzalezFriend
Messages: 188
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
I'm trying to understand how is the "View" menu filled. Specifically, the Menu items "Grid" and "Snap to Geometry".

I don't quite understand why they always appears (eg, in the tutorial), even greyed-out.
They seem to be some GEF thing, but browsing the GEF plugin I don't see any declarative addtion, only see that the entries correspond to the ToggleGridACtion and ToggleSnapToGeometryAction classes. This actions are (apparently) activated only programatically, and the Graphiti standard Editor does this with ToggleGridAction in DiagramBehaviour.initActionRegistry:

 ...
 IAction showGrid = new ToggleGridAction(diagramContainer.getGraphicalViewer());
 diagramContainer.getActionRegistry().registerAction(showGrid);
 ...


If I comment out those lines, the option appears disable in the menu (greyed out). But, why does it appear at all? Who adds it? Can't I remove it?

[Updated on: Tue, 06 May 2014 19:59]

Report message to a moderator

Re: View Menu: Grid and SnapToGeometry entries [message #1341480 is a reply to message #1337261] Thu, 08 May 2014 13:57 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,

the view menu is added to the menu in the DiagramEditorActionBarContributor,
method contributeToMenu. You might provide an own implementation for your
editor that does not add the menu.

Michael
Re: View Menu: Grid and SnapToGeometry entries [message #1341692 is a reply to message #1341480] Thu, 08 May 2014 16:00 Go to previous message
Hernan Gonzalez is currently offline Hernan GonzalezFriend
Messages: 188
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
Michael Wenz wrote on Thu, 08 May 2014 10:57
Hernan,

the view menu is added to the menu in the DiagramEditorActionBarContributor,
method contributeToMenu.

Michael


Oops, I missed, that. Thanks!

Previous Topic:Highlighting of Anchors
Next Topic:Default Context Menu Choices not working
Goto Forum:
  


Current Time: Tue Apr 16 10:59:34 GMT 2024

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

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

Back to the top