@ApiStatus.Internal
  @RequiresEdt
  public <T> void runExternalResolver(CompletableFuture<? extends T> operation,
                                      Consumer<T> resultHandler,
                                      Consumer<? super Throwable> errorHandler) {
    runBeforeExternalOperation();

    operation.whenComplete((result, throwable) -> {

      Runnable runnable = () -> {
        if (isDisposed()) return;
        runAfterExternalOperation();

        if (throwable != null) {
          errorHandler.accept(throwable);
          return;
        }

        if (result != null) {
          resultHandler.accept(result);
        }
      };

      ApplicationManager.getApplication().invokeLater(runnable, ModalityState.stateForComponent(getComponent()));
    });
  }
@ApiStatus.Internal
  @RequiresEdt
  public <T> void runExternalResolver(CompletableFuture<? extends T> operation,
                                      Consumer<T> resultHandler,
                                      Consumer<? super Throwable> errorHandler)