/*******************************************************************************\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
\r
@Override\r
protected void pageSelectionChanged(IWorkbenchPart part, ISelection selection) {\r
- if (!(selection instanceof StructuredResourceSelection)) {\r
- return;\r
- }\r
- \r
- StructuredResourceSelection s = (StructuredResourceSelection) selection;\r
+ StructuredResourceSelection s = SelectionAdapter.transformSelection(selection);\r
+\r
selectionAdapter.setCurrentSelection(s);\r
viewChanged = true;\r
- \r
- //if (s.getRootSelection() == null) {\r
- if (!(part instanceof ProcessEditor)) {\r
- //System.out.println("ShapeEditorView.pageSelectionChanged() no root selection");\r
- ((ProcessEditorSelectionAdapter)selectionAdapter).setEditorSelection(true);\r
- return;\r
+\r
+ /*\r
+ if (part instanceof ProcessEditor) {\r
+ ProcessEditor sender = (ProcessEditor)part;\r
+ if (!sender.getPlantResource().equals(plantResource)) {\r
+ selectionAdapter.setCurrentSelection(new StructuredResourceSelection());\r
+ selectionAdapter.setEditorSelection();\r
+ return;\r
+ }\r
} \r
- //if (!s.getRootSelection().getResource().getId().equals(plant.getResource().getId())) {\r
- ProcessEditor sender = (ProcessEditor)part;\r
- if (!sender.getPlantResource().equals(plantResource)) {\r
-// System.out.println("ShapeEditorView.pageSelectionChanged() not right group "\r
-// + s.getRootSelection().getResource().getId() + " != " + model.getResource().getId());\r
- selectionAdapter.setCurrentSelection(new StructuredResourceSelection());\r
- ((ProcessEditorSelectionAdapter)selectionAdapter).setEditorSelection(false);\r
- return;\r
- }\r
+ */\r
+ \r
selectionAdapter.setEditorSelection();\r
\r
}\r