Package com.nomagic.task
Interface RunnableWithProgress
@OpenApiAll
public interface RunnableWithProgress
Runnable for executing code with progress status.
// create runnable RunnableWithProgress runnable = new RunnableWithProgress() { public void run(ProgressStatus progressStatus) { int max = Integer.MAX_VALUE; progressStatus.init("Counting...", 0, max); for (int i = 0; i < max; ++i) { if (progressStatus.isCancel()) { // cancel clicked return; } progressStatus.increase(); } } }; // run with progress ProgressStatusRunner.runWithProgressStatus(runnable, "My progress", true, 0);
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(ProgressStatus progressStatus) Performs task with progress status.
-
Method Details
-
run
Performs task with progress status. The method should (initialize and) update the progress status to reflect the actual task progress.- Parameters:
progressStatus
- progress- See Also:
-