void (@NotNull AbstractProjectViewPane newPane) { AbstractProjectViewPane currentPane = getCurrentProjectViewPane(); Object selectedUserObject; if (currentPane != null) { if (currentPane != newPane) { currentPane.saveExpandedPaths(); } selectedUserObject = ArrayUtil.getFirstElement(currentPane.getSelectedUserObjects()); } else { selectedUserObject = null; } viewContentPanel.removeAll(); JComponent component = newPane.createComponent(); UIUtil.removeScrollBorder(component); viewContentPanel.setLayout(new BorderLayout()); viewContentPanel.add(component, BorderLayout.CENTER); currentViewId = newPane.getId(); String newSubId = currentViewSubId = newPane.getSubId(); viewContentPanel.revalidate(); viewContentPanel.repaint(); createToolbarActions(newPane); if (newPane.myTree != null) { myAutoScrollToSourceHandler.install(newPane.myTree); myAutoScrollToSourceHandler.onMouseClicked(newPane.myTree); newPane.myTree.setToggleClickCount(myOpenDirectoriesWithSingleClick.isSelected() ? 1 : 2); } newPane.restoreExpandedPaths(); if (selectedUserObject != null && newSubId != null) { if (SelectInProjectViewImplKt.getLOG().isDebugEnabled()) { SelectInProjectViewImplKt.getLOG().debug("Re-selecting " + selectedUserObject + " after switching to " + currentViewId); } project.getService(SelectInProjectViewImpl.class).ensureSelected( currentViewId, null, () -> ContainerUtil.getFirstItem(newPane.getElementsFromNode(selectedUserObject)), true, false, null ); } project.getMessageBus().syncPublisher(ProjectViewListener.TOPIC).paneShown(newPane, currentPane); logProjectViewPaneChangedEvent(project, currentPane, newPane); }