void (final String packageName) { if (!ApplicationManager.getApplication().isDispatchThread()) { ApplicationManager.getApplication().invokeLater(() -> handleInstallationStarted(packageName), ModalityState.stateForComponent(myMainPanel)); } else { handleInstallationStarted(packageName); } }