Package com.diffplug.common.swt
Class SwtExec.Blocking
- java.lang.Object
-
- com.diffplug.common.swt.SwtExec.Blocking
-
- All Implemented Interfaces:
java.util.concurrent.Executor
- Enclosing class:
- SwtExec
public static class SwtExec.Blocking extends java.lang.Object implements java.util.concurrent.ExecutorAn Executor (obtained viaSwtExec.blocking()) which adds a blockingget()method.- When `execute(Runnable)` is called from the SWT thread, the `Runnable` will be executed immediately.
- Else, the `Runnable` will be passed to
Display.syncExec.
- See Also:
SwtExec.blocking
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.lang.Runnable runnable)<T> Tget(java.util.function.Supplier<T> supplier)Performs a blocking get in the UI thread.java.util.concurrent.ExecutorguardOn(ControlWrapper guard)Returns an executor which will only execute if the given guard hasn't been disposed.java.util.concurrent.ExecutorguardOn(Control guard)Returns an executor which will only execute if the given guard hasn't been disposed.
-
-
-
Method Detail
-
guardOn
public java.util.concurrent.Executor guardOn(Control guard)
Returns an executor which will only execute if the given guard hasn't been disposed.
-
guardOn
public java.util.concurrent.Executor guardOn(ControlWrapper guard)
Returns an executor which will only execute if the given guard hasn't been disposed.
-
execute
public void execute(java.lang.Runnable runnable)
- Specified by:
executein interfacejava.util.concurrent.Executor
-
get
public <T> T get(java.util.function.Supplier<T> supplier)
Performs a blocking get in the UI thread.- Parameters:
supplier- will be executed in the UI thread.- Returns:
- the value which was returned by supplier.
-
-