From d0e20562120f75aa268c391a2e7e138a65468623 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Wed, 24 Mar 2010 23:10:11 +0000 Subject: [PATCH] New Set git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15209 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/actions/OpenContextMenu.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/OpenContextMenu.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/OpenContextMenu.java index f2a092e5..53f89ffa 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/OpenContextMenu.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/OpenContextMenu.java @@ -25,16 +25,15 @@ import org.simantics.h2d.editor.IDiagramEditor; import org.simantics.h2d.event.IEvent; import org.simantics.h2d.event.ReleaseEvent; import org.simantics.h2d.event.handler.IEventHandler; -import org.simantics.ui.action.GraphMenuManager; public class OpenContextMenu implements IEventHandler { - + Control control; IWorkbenchPartSite site; String menuId; - + MenuManager menuManager; - + public OpenContextMenu(Control control, IWorkbenchPartSite site, String menuId) { super(); @@ -46,14 +45,14 @@ public class OpenContextMenu implements IEventHandler { Menu menu = menuManager.createContextMenu(control); control.setMenu(menu); if (site != null) { - site.registerContextMenu(menuManager.getId(), menuManager, + site.registerContextMenu(menuManager.getId(), menuManager, site.getSelectionProvider()); } } } @Override - public boolean handle(final IDiagramEditor editor, IEvent _event) { + public boolean handle(final IDiagramEditor editor, IEvent _event) { final ReleaseEvent event = (ReleaseEvent)_event; control.getDisplay().asyncExec(new Runnable() { @@ -66,16 +65,16 @@ public class OpenContextMenu implements IEventHandler { new Point((int)event.dispPoint.getX(), (int)event.dispPoint.getY())); menuManager.getMenu().setData( new DiagramContextMenuData(editor, event) - ); - menuManager.getMenu().setVisible(true); + ); + menuManager.getMenu().setVisible(true); } - - }); - return true; - } - + + }); + return true; + } + protected MenuManager createPopupMenu() { - final MenuManager mm = new GraphMenuManager("Diagram Popup", menuId); + final MenuManager mm = new MenuManager("Diagram Popup", menuId); mm.setRemoveAllWhenShown(true); mm.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { -- 2.47.1