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
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
}\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