void (ServiceEvent e) { JBIterable<ServiceGroupNode> groups = findItems(e.target, e.contributorClass, false).filter(ServiceGroupNode.class); ServiceGroupNode first = groups.first(); if (first == null) return; //noinspection unchecked ServiceViewDescriptor viewDescriptor = ((ServiceViewGroupingContributor)first.getContributor()).getGroupDescriptor(e.target); for (ServiceViewItem group : groups) { group.setViewDescriptor(viewDescriptor); ServiceViewItem parent = group.getParent(); if (parent != null) { List<ServiceViewItem> children = parent.getChildren(); children.remove(group); addGroupOrdered(children, (ServiceGroupNode)group); } } }