public static void invokeLaterIfNeeded(@NotNull Runnable runnable) {
    if (EDT.isCurrentThreadEdt()) {
      runnable.run();
    }
    else {
      getInstance().invokeLater(runnable);
    }
  }
public static void invokeLaterIfNeeded(@NotNull Runnable runnable)