void (@NotNull DiffRequest request, boolean force, @Nullable ScrollToPolicy scrollToChangePolicy, boolean sync) { ThreadingAssertions.assertEventDispatchThread(); myIterationState = IterationState.NONE; force = force || (myQueuedApplyRequest != null && myQueuedApplyRequest.force); myQueuedApplyRequest = new ApplyData(request, force, scrollToChangePolicy); Runnable task = () -> { if (myQueuedApplyRequest == null || myDisposed) return; doApplyRequest(myQueuedApplyRequest.request, myQueuedApplyRequest.force, myQueuedApplyRequest.scrollToChangePolicy); myQueuedApplyRequest = null; }; if (sync) { task.run(); } else { IdeFocusManager.getInstance(myProject).doWhenFocusSettlesDown(task, ModalityState.current()); } }