PreviewDiffSplitterComponent (@NotNull MyShelvedPreviewProcessor changeProcessor) { PreviewDiffSplitterComponent previewSplitter = new PreviewDiffSplitterComponent(changeProcessor, SHELVE_PREVIEW_SPLITTER_PROPORTION); previewSplitter.setFirstComponent(myTreeScrollPane); DiffPreview.setPreviewVisible(previewSplitter, myVcsConfiguration.SHELVE_DETAILS_PREVIEW_SHOWN); myTree.addSelectionListener(() -> previewSplitter.updatePreview(false), changeProcessor); setContent(previewSplitter); Disposer.register(changeProcessor, () -> { setContent(myTreeScrollPane); }); return previewSplitter; }