Bug 573243 - Perform bulk selection instead of individually selection
Fixed append logic to bulk append selection
Change-Id: Ib92cece023514c7f7d73fef3efee2233649cfabb
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
index 05b1772..fba9e7f 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/GraphitiScrollingGraphicalViewer.java
@@ -140,12 +140,20 @@
if (model instanceof PictogramElement) {
PictogramElement[] pes = tbp.getSelections((PictogramElement) model);
if (pes != null) {
+ List<Object> parts = new ArrayList<>();
for (PictogramElement pe : pes) {
EditPart editPart = (EditPart) getEditPartRegistry().get(pe);
if (editPart != null) {
- super.appendSelection(editPart);
+ parts.add(editPart);
}
}
+ List<Object> selections = new ArrayList<>();
+ ISelection oldSelection = super.getSelection();
+ if (oldSelection instanceof IStructuredSelection) {
+ selections.addAll(((IStructuredSelection) oldSelection).toList());
+ }
+ selections.addAll(parts);
+ super.setSelection(new StructuredSelection(selections));
}
}
}