Class SwtExec.Blocking

java.lang.Object
com.diffplug.common.swt.SwtExec.Blocking
All Implemented Interfaces:
Executor
Enclosing class:
SwtExec

public static class SwtExec.Blocking extends Object implements Executor
An Executor (obtained via SwtExec.blocking()) which adds a blocking get() 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 Details

    • guardOn

      public Executor guardOn(Control guard)
      Returns an executor which will only execute if the given guard hasn't been disposed.
    • guardOn

      public Executor guardOn(com.diffplug.common.swt.ControlWrapper guard)
      Returns an executor which will only execute if the given guard hasn't been disposed.
    • execute

      public void execute(Runnable runnable)
      Specified by:
      execute in interface Executor
    • get

      public <T> T get(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.