Class 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.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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(java.lang.Runnable runnable)  
      <T> T get​(java.util.function.Supplier<T> supplier)
      Performs a blocking get in the UI thread.
      java.util.concurrent.Executor guardOn​(ControlWrapper guard)
      Returns an executor which will only execute if the given guard hasn't been disposed.
      java.util.concurrent.Executor guardOn​(Control guard)
      Returns an executor which will only execute if the given guard hasn't been disposed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        execute in interface java.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.