private void addService(ServiceEvent e) {
    if (e.parent != null) {
      ServiceViewItem parent = findItemSafe(e.parent, e.contributorClass);
      ServiceViewContributor<?> parentContributor = parent instanceof ServiceNode ? ((ServiceNode)parent).getProvidingContributor() : null;
      if (parentContributor == null) {
        LOG.debug("Parent not found; event: " + e);
        return;
      }

      if (!hasChild(parent, e.target)) {
        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;
      }
    }

    if (!hasChild(contributorNode, e.target)) {
      addService(e.target, contributorNode.getChildren(), myProject, contributorNode, contributorNode.getContributor());
    }
  }
private void addService(ServiceEvent e)