ActionCallback () { if (isReleased()) return ActionCallback.REJECTED; setCancelRequested(true); ActionCallback done = new ActionCallback(); invokeLaterIfNeeded(false, new TreeRunnable("AbstractTreeUi.cancelUpdate") { @Override public void perform() { if (isReleased()) { done.setRejected(); return; } if (myResettingToReadyNow.get()) { _getReady().notify(done); } else if (isReady()) { resetToReadyNow(); done.setDone(); } else { if (isIdle() && hasPendingWork()) { resetToReadyNow(); done.setDone(); } else { _getReady().notify(done); } } maybeReady(); } }); if (isEdt() || isPassthroughMode()) { maybeReady(); } return done; }