PreviewDiffSplitterComponent (@NotNull ChangesViewDiffPreviewProcessor changeProcessor) { PreviewDiffSplitterComponent previewSplitter = new PreviewDiffSplitterComponent(changeProcessor, CHANGES_VIEW_PREVIEW_SPLITTER_PROPORTION); previewSplitter.setFirstComponent(myContentPanel); DiffPreview.setPreviewVisible(previewSplitter, myVcsConfiguration.LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN); myView.addSelectionListener(() -> { boolean fromModelRefresh = myModelUpdateInProgress; invokeLater(() -> previewSplitter.updatePreview(fromModelRefresh)); }, changeProcessor); myMainPanel.addToCenter(previewSplitter); Disposer.register(changeProcessor, () -> { if (Disposer.isDisposed(this)) return; myMainPanel.remove(previewSplitter); myMainPanel.addToCenter(myContentPanel); myMainPanel.revalidate(); myMainPanel.repaint(); }); return previewSplitter; }