EditorTabPreview (@NotNull ChangesViewDiffPreviewProcessor changeProcessor, boolean hasSplitterPreview) { return new SimpleTreeEditorDiffPreview(changeProcessor, myView, myContentPanel, isOpenEditorDiffPreviewWithSingleClick.asBoolean() && !hasSplitterPreview) { @Override public void returnFocusToTree() { ToolWindow toolWindow = getToolWindowFor(myProject, LOCAL_CHANGES); if (toolWindow != null) toolWindow.activate(null); } @Override public void updateDiffAction(@NotNull AnActionEvent e) { ShowDiffFromLocalChangesActionProvider.updateAvailability(e); } @Override protected String getCurrentName() { String changeName = changeProcessor.getCurrentChangeName(); return changeName != null ? VcsBundle.message("commit.editor.diff.preview.title", changeName) : VcsBundle.message("commit.editor.diff.preview.empty.title"); } @Override protected boolean skipPreviewUpdate() { if (super.skipPreviewUpdate()) return true; if (!myView.equals(IdeFocusManager.getInstance(myProject).getFocusOwner())) return true; if (!isPreviewOpen() && !isEditorPreviewAllowed()) return true; return myModelUpdateInProgress; } @Override protected boolean isPreviewOnDoubleClickAllowed() { return isCommitToolWindowShown(myProject) ? VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK : VcsApplicationSettings.getInstance().SHOW_DIFF_ON_DOUBLE_CLICK; } @Override protected boolean isPreviewOnEnterAllowed() { return isCommitToolWindowShown(myProject) ? VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK : VcsApplicationSettings.getInstance().SHOW_DIFF_ON_DOUBLE_CLICK; } }; }