]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java
Set copyright texts for java files in the latest development branches.
[simantics/3d.git] / org.simantics.proconf.g3d / src / org / simantics / proconf / g3d / base / ThreeDimensionalEditorPart.java
index 3e99d5efebc992626c9eed496cd1f11e3667dc70..a3da25103e60cff356df0fb9c8c87c1c532c36fb 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
  * All rights reserved. This program and the accompanying materials\r
  * are made available under the terms of the Eclipse Public License v1.0\r
  * which accompanies this distribution, and is available at\r
@@ -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