]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Selection events coming from other editors/views should be fixed.
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 22 Jan 2009 15:27:52 +0000 (15:27 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 22 Jan 2009 15:27:52 +0000 (15:27 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@8809 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java

index 3e99d5efebc992626c9eed496cd1f11e3667dc70..702037b6756f26cb4fecf37bedb3321515f83965 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Display;\r
 import org.eclipse.ui.IActionBars;\r
-import org.eclipse.ui.IPartListener;\r
 import org.eclipse.ui.ISelectionListener;\r
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.simantics.db.Graph;\r
@@ -139,12 +138,14 @@ public abstract class ThreeDimensionalEditorPart extends ResourceEditorPart impl
     private void hookPageSelection() {\r
         pageSelectionListener = new ISelectionListener() {\r
             public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
-                if (part == ThreeDimensionalEditorPart.this)\r
-                    return;\r
+                if (part == ThreeDimensionalEditorPart.this) {\r
+                       return;\r
+                }\r
                 pageSelectionChanged(part, selection);\r
             }\r
         };\r
         getSite().getPage().addPostSelectionListener(pageSelectionListener);\r
+        getSite().getPage().addSelectionListener(pageSelectionListener);\r
         ISelection sel = getSite().getPage().getSelection();\r
         IWorkbenchPart wb = getSite().getPage().getActivePart();\r
         pageSelectionChanged(wb, sel);\r
@@ -161,8 +162,10 @@ public abstract class ThreeDimensionalEditorPart extends ResourceEditorPart impl
     }\r
     \r
     public void dispose() {\r
-       if (pageSelectionListener != null)\r
+       if (pageSelectionListener != null) {\r
             getSite().getPage().removePostSelectionListener(pageSelectionListener);\r
+               getSite().getPage().removeSelectionListener(pageSelectionListener);\r
+       }\r
         editor.dispose();\r
        super.dispose();\r
     }\r