void (Class<?> contributorClass) { int index = -1; if (myRoots.isEmpty()) { index = 0; } else { ServiceViewItem contributorNode = null; for (int i = 0; i < myRoots.size(); i++) { ServiceViewItem child = myRoots.get(i); if (contributorClass.isInstance(child.getContributor())) { contributorNode = child; index = i; break; } } if (contributorNode != null) { myRoots.remove(contributorNode); } else { index = getContributorNodeIndex(contributorClass); } } ContributorNode newRoot = null; for (ServiceViewContributor<?> contributor : CONTRIBUTOR_EP_NAME.getExtensionList()) { if (contributorClass.isInstance(contributor)) { newRoot = new ContributorNode(myProject, contributor); newRoot.loadChildren(); if (newRoot.getChildren().isEmpty()) { newRoot = null; } break; } } if (newRoot != null) { myRoots.add(index, newRoot); } }