public class SwingTaskExecutors extends Object
SwingTaskExecutor instances| Modifier and Type | Method and Description |
|---|---|
static <T> SwingTaskExecutorBuilder<T> |
create(Supplier<T> supplier)
Start creating a
SwingTaskExecutor using a
SwingTaskExecutorBuilder. |
static <T> SwingTaskExecutorBuilder<T> |
create(Supplier<T> supplier,
Consumer<? super T> consumer)
Start creating a
SwingTaskExecutor using a
SwingTaskExecutorBuilder. |
static <T> SwingTaskExecutorBuilder<T> |
create(SwingTask<T,?> swingTask)
Start creating a
SwingTaskExecutor using a
SwingTaskExecutorBuilder. |
static SwingTaskExecutorBuilder<Void> |
createSimple(Runnable runnable)
Start creating a
SwingTaskExecutor using a
SwingTaskExecutorBuilder. |
public static <T> SwingTaskExecutorBuilder<T> create(SwingTask<T,?> swingTask)
SwingTaskExecutor using a
SwingTaskExecutorBuilder.
By default, the builder will be configured as follows:
decision delay will be 300ms. After this time, it will decide
whether a dialog should be shown or not.
duration
to pop up will be 1000ms. After the decision delay has passed,
the completion time of the task will be predicated based on
the progress that
was reported by the task. If the predicted completion time is
more than this time, the dialog will be shown. If the task
actually takes more than this time, a dialog will be shown in
any case
modal.
cancelable.
title saying
"Working"
parent component
parent window
uncaught exception handler
T - The result type of the SwingTaskswingTask - The SwingTask to executeSwingTaskExecutorBuilderpublic static SwingTaskExecutorBuilder<Void> createSimple(Runnable runnable)
SwingTaskExecutor using a
SwingTaskExecutorBuilder.
This will just call create(SwingTask) using a SwingTask
that was created from the given Runnable.
NOTE: Any exceptions caused by the runnable (including exceptions
that are caused by interrupting or canceling the SwingTask)
will be ignored.
runnable - The runnableSwingTaskExecutorBuilderpublic static <T> SwingTaskExecutorBuilder<T> create(Supplier<T> supplier)
SwingTaskExecutor using a
SwingTaskExecutorBuilder.
This will just call create(SwingTask) using a SwingTask
that was created from the given Supplier.
NOTE: Any exceptions caused by the supplier (including exceptions
that are caused by interrupting or canceling the SwingTask)
will be ignored.
T - The type of the supplied objectssupplier - The supplierSwingTaskExecutorBuilderpublic static <T> SwingTaskExecutorBuilder<T> create(Supplier<T> supplier, Consumer<? super T> consumer)
SwingTaskExecutor using a
SwingTaskExecutorBuilder.
This will just call create(SwingTask) using a SwingTask
that was created from the given Supplier and
Consumer as follows:
The SwingTask calls the given supplier. The result that is
provided by the supplier will be obtained from the SwingTask,
and passed to the given consumer (if the consumer is not
null)
NOTE: Any exceptions caused by the supplier (including exceptions
that are caused by interrupting or canceling the SwingTask)
will be ignored. If an exception occurs, then the consumer will
not be called.
T - The type of the resultsupplier - The supplierconsumer - The consumerSwingTaskExecutorBuilderCopyright © 2016. All rights reserved.