});
}
private void updateSelectionAfterDelete(Runnable runnable) {
Tree tree = (Tree) getControl();
IStructuredSelection selection = (IStructuredSelection) getSelection();
/* Nothing to do, since no selection */
if (selection.isEmpty()) {
runnable.run();
return;
}
/* Look for the minimal Index of all selected Elements */
int minSelectedIndex = Integer.MAX_VALUE;
TreeItemAdapter parentOfMinSelected = new TreeItemAdapter(tree);
/* For each selected Element */
Object[] selectedElements = selection.toArray();
for (Object selectedElement : selectedElements) {
Widget widget = findItem(selectedElement);
if (widget instanceof TreeItem) {
TreeItem item = (TreeItem) widget;
TreeItemAdapter parent = new TreeItemAdapter(item).getParent();