void (Runnable runnable) { ModalityState modality = ModalityState.current(); ApplicationManager.getApplication().invokeLater( () -> IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(runnable, modality), modality); }