Class UIThreadsUtil

java.lang.Object
org.omegat.util.gui.UIThreadsUtil

public final class UIThreadsUtil extends Object
Utils for check UI threads and run specific code in UI threads only.
  • Method Details

    • executeInSwingThread

      public static void executeInSwingThread(Runnable code)
      Execute code in swing thread only.
    • returnResultFromSwingThread

      public static <T> T returnResultFromSwingThread(Supplier<T> s)
    • mustBeSwingThread

      public static void mustBeSwingThread()
      Check if current thread is swing thread, and report error in log if it's not true.
    • mustNotBeSwingThread

      public static void mustNotBeSwingThread()
      Check if current thread is NOT swing thread, and report error in log if it's not true.