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);
     
    See Also:
    ProgressStatusRunner
    • Method Detail

      • run

        void run​(ProgressStatus progressStatus)
        Performs task with progress status. The method should (initialize and) update the progress status to reflect the actual task progress.
        Parameters:
        progressStatus -
        See Also:
        ProgressStatus