]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
New Set
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 24 Mar 2010 23:10:11 +0000 (23:10 +0000)
committerlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 24 Mar 2010 23:10:11 +0000 (23:10 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15209 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/actions/OpenContextMenu.java

index f2a092e5327b4f0e93fb023736e69c9093ce195a..53f89ffa4540931d4aa64f5b9d6e8660c01154d2 100644 (file)
@@ -25,16 +25,15 @@ import org.simantics.h2d.editor.IDiagramEditor;
 import org.simantics.h2d.event.IEvent;\r
 import org.simantics.h2d.event.ReleaseEvent;\r
 import org.simantics.h2d.event.handler.IEventHandler;\r
-import org.simantics.ui.action.GraphMenuManager;\r
 \r
 public class OpenContextMenu implements IEventHandler {\r
-    \r
+\r
     Control control;\r
     IWorkbenchPartSite site;\r
     String menuId;\r
-    \r
+\r
     MenuManager menuManager;\r
-    \r
+\r
     public OpenContextMenu(Control control, IWorkbenchPartSite site,\r
             String menuId) {\r
         super();\r
@@ -46,14 +45,14 @@ public class OpenContextMenu implements IEventHandler {
             Menu menu = menuManager.createContextMenu(control);\r
             control.setMenu(menu);\r
             if (site != null) {\r
-                site.registerContextMenu(menuManager.getId(), menuManager, \r
+                site.registerContextMenu(menuManager.getId(), menuManager,\r
                         site.getSelectionProvider());\r
             }\r
         }\r
     }\r
 \r
     @Override\r
-       public boolean handle(final IDiagramEditor editor, IEvent _event) {\r
+    public boolean handle(final IDiagramEditor editor, IEvent _event) {\r
         final ReleaseEvent event = (ReleaseEvent)_event;\r
         control.getDisplay().asyncExec(new Runnable() {\r
 \r
@@ -66,16 +65,16 @@ public class OpenContextMenu implements IEventHandler {
                         new Point((int)event.dispPoint.getX(), (int)event.dispPoint.getY()));\r
                 menuManager.getMenu().setData(\r
                         new DiagramContextMenuData(editor, event)\r
-                        );\r
-                menuManager.getMenu().setVisible(true);                \r
+                );\r
+                menuManager.getMenu().setVisible(true);\r
             }\r
-                   \r
-               });\r
-               return true;\r
-       }\r
-    \r
+\r
+        });\r
+        return true;\r
+    }\r
+\r
     protected MenuManager createPopupMenu() {\r
-        final MenuManager mm = new GraphMenuManager("Diagram Popup", menuId);\r
+        final MenuManager mm = new MenuManager("Diagram Popup", menuId);\r
         mm.setRemoveAllWhenShown(true);\r
         mm.addMenuListener(new IMenuListener() {\r
             public void menuAboutToShow(IMenuManager manager) {\r