void (@NotNull ChangesListView view, @NotNull DefaultTreeModel newModel) { TreeState state = TreeState.createOn(view, view.getRoot()); state.setScrollToSelection(false); ChangesBrowserNode<?> oldRoot = view.getRoot(); view.setModel(newModel); ChangesBrowserNode<?> newRoot = view.getRoot(); state.applyTo(view, newRoot); initTreeStateIfNeeded(view, oldRoot, newRoot); }