Search in sources :

Example 1 with SimpleDiffRequestChain

use of com.intellij.diff.chains.SimpleDiffRequestChain in project intellij-community by JetBrains.

the class DiffManagerImpl method showDiffBuiltin.

@Override
public void showDiffBuiltin(@Nullable Project project, @NotNull DiffRequest request, @NotNull DiffDialogHints hints) {
    DiffRequestChain requestChain = new SimpleDiffRequestChain(request);
    showDiffBuiltin(project, requestChain, hints);
}
Also used : SimpleDiffRequestChain(com.intellij.diff.chains.SimpleDiffRequestChain) DiffRequestChain(com.intellij.diff.chains.DiffRequestChain) SimpleDiffRequestChain(com.intellij.diff.chains.SimpleDiffRequestChain)

Example 2 with SimpleDiffRequestChain

use of com.intellij.diff.chains.SimpleDiffRequestChain in project intellij-community by JetBrains.

the class ExternalDiffTool method show.

public static void show(@Nullable final Project project, @NotNull final DiffRequestChain chain, @NotNull final DiffDialogHints hints) {
    try {
        //noinspection unchecked
        final Ref<List<DiffRequest>> requestsRef = new Ref<>();
        final Ref<Throwable> exceptionRef = new Ref<>();
        ProgressManager.getInstance().run(new Task.Modal(project, "Loading Requests", true) {

            @Override
            public void run(@NotNull ProgressIndicator indicator) {
                try {
                    requestsRef.set(collectRequests(project, chain, indicator));
                } catch (Throwable e) {
                    exceptionRef.set(e);
                }
            }
        });
        if (!exceptionRef.isNull())
            throw exceptionRef.get();
        List<DiffRequest> showInBuiltin = new ArrayList<>();
        for (DiffRequest request : requestsRef.get()) {
            if (canShow(request)) {
                showRequest(project, request);
            } else {
                showInBuiltin.add(request);
            }
        }
        if (!showInBuiltin.isEmpty()) {
            DiffManagerEx.getInstance().showDiffBuiltin(project, new SimpleDiffRequestChain(showInBuiltin), hints);
        }
    } catch (ProcessCanceledException ignore) {
    } catch (Throwable e) {
        LOG.warn(e);
        Messages.showErrorDialog(project, e.getMessage(), "Can't Show Diff In External Tool");
    }
}
Also used : Task(com.intellij.openapi.progress.Task) ArrayList(java.util.ArrayList) ContentDiffRequest(com.intellij.diff.requests.ContentDiffRequest) DiffRequest(com.intellij.diff.requests.DiffRequest) Ref(com.intellij.openapi.util.Ref) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) ArrayList(java.util.ArrayList) List(java.util.List) SimpleDiffRequestChain(com.intellij.diff.chains.SimpleDiffRequestChain) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException)

Example 3 with SimpleDiffRequestChain

use of com.intellij.diff.chains.SimpleDiffRequestChain in project intellij-community by JetBrains.

the class DiffManagerImpl method showDiff.

@Override
public void showDiff(@Nullable Project project, @NotNull DiffRequest request, @NotNull DiffDialogHints hints) {
    DiffRequestChain requestChain = new SimpleDiffRequestChain(request);
    showDiff(project, requestChain, hints);
}
Also used : SimpleDiffRequestChain(com.intellij.diff.chains.SimpleDiffRequestChain) DiffRequestChain(com.intellij.diff.chains.DiffRequestChain) SimpleDiffRequestChain(com.intellij.diff.chains.SimpleDiffRequestChain)

Aggregations

SimpleDiffRequestChain (com.intellij.diff.chains.SimpleDiffRequestChain)3 DiffRequestChain (com.intellij.diff.chains.DiffRequestChain)2 ContentDiffRequest (com.intellij.diff.requests.ContentDiffRequest)1 DiffRequest (com.intellij.diff.requests.DiffRequest)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 Ref (com.intellij.openapi.util.Ref)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1