public static void addToInvokeLater(final Runnable runnable){
  final Application application=ApplicationManager.getApplication();
  final boolean unitTestMode=application.isUnitTestMode();
  if (unitTestMode) {
    UIUtil.invokeLaterIfNeeded(runnable);
  }
 else   if (application.isHeadlessEnvironment() || application.isDispatchThread()) {
    runnable.run();
  }
 else {
    TRANSFER_TO_EDT_QUEUE.offer(runnable);
  }
}

public static void addToInvokeLater ( final Runnable runnable ) { final Application application = ApplicationManager . getApplication ( ) ; final boolean unitTestMode = application . isUnitTestMode ( ) ; if ( unitTestMode ) { UIUtil . invokeLaterIfNeeded ( runnable ) ; } else if ( application . isHeadlessEnvironment ( ) || application . isDispatchThread ( ) ) { runnable . run ( ) ; } else { TRANSFER_TO_EDT_QUEUE . offer ( runnable ) ; } }
adds runnable to event dispatch queue if we aren ' t in unittest of headless environment mode
