Class DefaultViewModelSwingWorkerExecutor

java.lang.Object
com.inductiveautomation.ignition.designer.mvvm.DefaultViewModelSwingWorkerExecutor
All Implemented Interfaces:
ViewModelSwingWorkerExecutor

public class DefaultViewModelSwingWorkerExecutor extends Object implements ViewModelSwingWorkerExecutor
  • Constructor Details

    • DefaultViewModelSwingWorkerExecutor

      public DefaultViewModelSwingWorkerExecutor()
  • Method Details

    • execute

      public <T> BiConsumer<Boolean,Boolean> execute(FragileSupplier<T,Exception> onDoInBackground, BiConsumer<T,Exception> onDone, long timeoutInMS)
      Description copied from interface: ViewModelSwingWorkerExecutor
      Method is used in a swing analogous manor. The backing implementation is a SwingWorker. You use this method when you need to perform a task that has no progress. In most cases you want to specify a timeout, which is the time for which you will decide that the task is dead, or hung.
      Specified by:
      execute in interface ViewModelSwingWorkerExecutor
      Type Parameters:
      T - The expected output from onDoInBackground
      Parameters:
      onDoInBackground - This will execute on a non-EDT thread. Should return a value to be used by onDone
      onDone - This will execute on the EDT. Will provide the result of onDoInBackground, or null if errors have been encountered. The following errors are available: InterruptedException, ExecutionException TimeoutException
      timeoutInMS - To prevent an indefinite wait, supply a timeout. A value equal or less than 0 means that a timeout will not be used.
      Returns:
      This Consumer allows you to cancel the thread. Corresponds to SwingWorker's cancel() method.