Package org.omegat.util.gui
Class UIThreadsUtil
- java.lang.Object
-
- org.omegat.util.gui.UIThreadsUtil
-
public final class UIThreadsUtil extends java.lang.Object
Utils for check UI threads and run specific code in UI threads only.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
executeInSwingThread(java.lang.Runnable code)
Execute code in swing thread only.static void
mustBeSwingThread()
Check if current thread is swing thread, and report error in log if it's not true.static void
mustNotBeSwingThread()
Check if current thread is NOT swing thread, and report error in log if it's not true.static <T> T
returnResultFromSwingThread(java.util.function.Supplier<T> s)
-
-
-
Method Detail
-
executeInSwingThread
public static void executeInSwingThread(java.lang.Runnable code)
Execute code in swing thread only.
-
returnResultFromSwingThread
public static <T> T returnResultFromSwingThread(java.util.function.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.
-
-