Skip to main content



      Home
Home » Modeling » Graphiti » View Menu: Grid and SnapToGeometry entries
View Menu: Grid and SnapToGeometry entries [message #1337261] Tue, 06 May 2014 15:58 Go to next message
Eclipse UserFriend
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 15:59] by Moderator

Re: View Menu: Grid and SnapToGeometry entries [message #1341480 is a reply to message #1337261] Thu, 08 May 2014 09:57 Go to previous messageGo to next message
Eclipse UserFriend
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 12:00 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 13:24:25 EDT 2025

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

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

Back to the top