X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.proconf.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FThreeDimensionalEditorPart.java;h=a3da25103e60cff356df0fb9c8c87c1c532c36fb;hb=9ad91ae4a059a4c7b219d2560c5b8b8ed1c5f184;hp=3e99d5efebc992626c9eed496cd1f11e3667dc70;hpb=f9e3fe0569bf1cf3bbcdbc56fb81c736cba086f9;p=simantics%2F3d.git 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..a3da2510 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. + * Copyright (c) 2007- VTT Technical Research Centre of Finland. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -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(); }