From: luukkainen Date: Thu, 22 Jan 2009 15:27:52 +0000 (+0000) Subject: Selection events coming from other editors/views should be fixed. X-Git-Tag: simantics-1.19.0~20^2~8 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=5dbf2f399a4f511a8b27e6a23f44c15e6dfa9073;p=simantics%2F3d.git Selection events coming from other editors/views should be fixed. git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@8809 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java index 3e99d5ef..702037b6 100644 --- a/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java +++ b/org.simantics.proconf.g3d/src/org/simantics/proconf/g3d/base/ThreeDimensionalEditorPart.java @@ -15,7 +15,6 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IPartListener; import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.IWorkbenchPart; import org.simantics.db.Graph; @@ -139,12 +138,14 @@ public abstract class ThreeDimensionalEditorPart extends ResourceEditorPart impl private void hookPageSelection() { pageSelectionListener = new ISelectionListener() { public void selectionChanged(IWorkbenchPart part, ISelection selection) { - if (part == ThreeDimensionalEditorPart.this) - return; + if (part == ThreeDimensionalEditorPart.this) { + return; + } pageSelectionChanged(part, selection); } }; getSite().getPage().addPostSelectionListener(pageSelectionListener); + getSite().getPage().addSelectionListener(pageSelectionListener); ISelection sel = getSite().getPage().getSelection(); IWorkbenchPart wb = getSite().getPage().getActivePart(); pageSelectionChanged(wb, sel); @@ -161,8 +162,10 @@ public abstract class ThreeDimensionalEditorPart extends ResourceEditorPart impl } public void dispose() { - if (pageSelectionListener != null) + if (pageSelectionListener != null) { getSite().getPage().removePostSelectionListener(pageSelectionListener); + getSite().getPage().removeSelectionListener(pageSelectionListener); + } editor.dispose(); super.dispose(); }