void (@NotNull EdtReplacementThread thread, @NotNull ModalityState modalityState, @NotNull Runnable r) { switch (thread) { case EDT: SwingUtilities.invokeLater(r); break; case WT: ApplicationManager.getApplication().invokeLaterOnWriteThread(r, modalityState); break; case EDT_WITH_IW: ApplicationManager.getApplication().invokeLater(r, modalityState); break; } }