void (ServiceEvent e) { ServiceViewItem item = findItem(e.target, e.contributorClass); if (item != null) return; if (e.parent != null) { ServiceViewItem parent = findItem(e.parent, e.contributorClass); ServiceViewContributor<?> parentContributor = parent instanceof ServiceNode ? ((ServiceNode)parent).getProvidingContributor() : null; if (parentContributor == null) return; addService(e.target, parent.getChildren(), myProject, parent, parentContributor); return; } ServiceViewItem contributorNode = null; for (ServiceViewItem child : myRoots) { if (e.contributorClass.isInstance(child.getContributor())) { contributorNode = child; break; } } if (contributorNode == null) { int index = getContributorNodeIndex(e.contributorClass); for (ServiceViewContributor<?> contributor : CONTRIBUTOR_EP_NAME.getExtensionList()) { if (e.contributorClass.isInstance(contributor)) { contributorNode = new ContributorNode(myProject, contributor); myRoots.add(index, contributorNode); break; } } if (contributorNode == null) { return; } } addService(e.target, contributorNode.getChildren(), myProject, contributorNode, contributorNode.getContributor()); }