Class DefaultViewModelSwingWorkerExecutor
java.lang.Object
com.inductiveautomation.ignition.designer.mvvm.DefaultViewModelSwingWorkerExecutor
- All Implemented Interfaces:
ViewModelSwingWorkerExecutor
public class DefaultViewModelSwingWorkerExecutor
extends Object
implements ViewModelSwingWorkerExecutor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> BiConsumer<Boolean,
Boolean> execute
(FragileSupplier<T, Exception> onDoInBackground, BiConsumer<T, Exception> onDone, long timeoutInMS) Method is used in a swing analogous manor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.designer.mvvm.ViewModelSwingWorkerExecutor
execute
-
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 aSwingWorker
. 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 interfaceViewModelSwingWorkerExecutor
- Type Parameters:
T
- The expected output fromonDoInBackground
- Parameters:
onDoInBackground
- This will execute on a non-EDT thread. Should return a value to be used byonDone
onDone
- This will execute on the EDT. Will provide the result ofonDoInBackground
, 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.
-