private void flushPending() { for (Request each : myPendingRequests) { _add(each); } myPendingRequests.clear(); }
private void _addRequest(final Runnable request, long delayMillis, ModalityState modalityState) { synchronized (LOCK) { LOG.assertTrue(!myDisposed, "Already disposed"); final Request requestToSchedule = new Request(request, modalityState, delayMillis); if (myActivationComponent == null || myActivationComponent.isShowing()) { _add(requestToSchedule); } else { if (!myPendingRequests.contains(requestToSchedule)) { myPendingRequests.add(requestToSchedule); } } } }