void (Object @NotNull [] elements, int i, @Nullable Runnable onDone, int[] originalRows, boolean deferred, boolean scrollToVisible, boolean canSmartExpand) { if (i >= elements.length) { if (myTree.isSelectionEmpty()) { myTree.setSelectionRows(originalRows); } runDone(onDone); } else { if (!checkDeferred(deferred, onDone)) { return; } doSelect(elements[i], new TreeRunnable("AbstractTreeUi.addNext") { @Override public void perform() { if (!checkDeferred(deferred, onDone)) return; addNext(elements, i + 1, onDone, originalRows, deferred, scrollToVisible, canSmartExpand); } }, deferred, i == 0, scrollToVisible, canSmartExpand); } }