void (@Nullable Project project, @NotNull ExternalDiffSettings.ExternalTool externalTool, @NotNull TestOutputConsole outputConsole) { JComponent parentComponent = outputConsole.getComponent(); try { Document document = new DocumentImpl(DiffBundle.message("settings.external.diff.original.output.file.content")); Consumer<? super MergeResult> callback = (result) -> { String message = result == MergeResult.CANCEL ? DiffBundle.message("settings.external.diff.merge.conflict.resolve.was.canceled") : DiffBundle.message("settings.external.diff.merge.conflict.resolve.successful", StringUtil.shortenPathWithEllipsis(document.getText(), 60)); Messages.showInfoMessage(message, DiffBundle.message("settings.external.diff.test.complete")); }; List<String> contents = Arrays.asList(DiffBundle.message("settings.external.diff.left.file.content"), DiffBundle.message("settings.external.diff.base.file.content"), DiffBundle.message("settings.external.diff.right.file.content")); List<String> titles = Arrays.asList("Left", "Base", "Right"); // NON-NLS MergeRequest request = DiffRequestFactory.getInstance() .createMergeRequest(null, PlainTextFileType.INSTANCE, document, contents, null, titles, callback); handleMergeRequest(request, () -> { return runWithTempMergeFiles(project, (ThreesideMergeRequest)request, (outputFile, inputFiles) -> { try { GeneralCommandLine commandLine = createMergeCommandLine(externalTool, outputFile, inputFiles); KillableProcessHandler processHandler = new TestKillableProcessHandler(commandLine); addLoggingListener(outputConsole, commandLine, processHandler); processHandler.startNotify(); return waitMergeProcessWithModal(project, processHandler.getProcess(), externalTool.isMergeTrustExitCode(), parentComponent); } catch (ExecutionException e) { throw new IOException(e); } }); }); } catch (Exception e) { Messages.showErrorDialog(parentComponent, e.getMessage(), DiffBundle.message("error.cannot.show.merge")); } }