void (boolean now, boolean forced, boolean includeInvisible) { if (myInUpdate) return; Runnable updateRunnable = new MyUpdateRunnable(this, forced, includeInvisible); Application application = ApplicationManager.getApplication(); if (now || application.isUnitTestMode() && application.isDispatchThread()) { updateRunnable.run(); } else if (!application.isHeadlessEnvironment()) { IdeFocusManager focusManager = IdeFocusManager.getInstance(null); if (application.isDispatchThread()) { application.runReadAction(() -> focusManager.doWhenFocusSettlesDown(updateRunnable)); } else { UiNotifyConnector.doWhenFirstShown(myComponent, () -> focusManager.doWhenFocusSettlesDown(updateRunnable)); } } }