EditorTabPreview (@NotNull MyShelvedPreviewProcessor changeProcessor, boolean hasSplitterPreview) { return new SimpleTreeEditorDiffPreview(changeProcessor, myTree, myTreeScrollPane, isOpenEditorDiffPreviewWithSingleClick.asBoolean() && !hasSplitterPreview) { @Override public void returnFocusToTree() { ToolWindow toolWindow = getToolWindowFor(myProject, SHELF); if (toolWindow != null) toolWindow.activate(null); } @Override public void updateDiffAction(@NotNull AnActionEvent event) { DiffShelvedChangesActionProvider.updateAvailability(event); } @Override protected String getCurrentName() { Wrapper myCurrentShelvedElement = changeProcessor.getCurrentChange(); return myCurrentShelvedElement != null ? VcsBundle.message("shelve.editor.diff.preview.title", myCurrentShelvedElement.getPresentableName()) : VcsBundle.message("shelved.version.name"); } @Override protected boolean skipPreviewUpdate() { if (super.skipPreviewUpdate()) return true; if (!myTree.equals(IdeFocusManager.getInstance(myProject).getFocusOwner())) return true; if (!isPreviewOpen() && !isEditorPreviewAllowed()) return true; return false; } }; }