void (ServiceEvent e) { ServiceViewItem item = findItem(e.target, e.contributorClass); if (item == null) return; ServiceViewItem parent = item.getParent(); while (parent instanceof ServiceGroupNode) { item.markRemoved(); parent.getChildren().remove(item); if (!parent.getChildren().isEmpty()) return; item = parent; parent = parent.getParent(); } if (parent instanceof ContributorNode) { item.markRemoved(); parent.getChildren().remove(item); if (!parent.getChildren().isEmpty()) return; item = parent; parent = parent.getParent(); } item.markRemoved(); if (parent == null) { myRoots.remove(item); } else { parent.getChildren().remove(item); } }