Interface ProgressListener

All Known Subinterfaces:
SyncProgressListener

public interface ProgressListener
Receives progress notifications from a long-running job, such as a merge, and lets the caller cancel it. Optional wherever it is accepted; pass null when progress is not of interest.
Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notifies that the work is done: the job has completed or was canceled.
    boolean
    Answers whether the job should be canceled.
    void
    Notifies that a subtask of the job is beginning.
    void
    worked(int work)
    Notifies that a number of units of work have been completed.
  • Method Details

    • done

      void done()
      Notifies that the work is done: the job has completed or was canceled. This method may be called more than once.
      Since:
      2.0
    • isCanceled

      boolean isCanceled()
      Answers whether the job should be canceled. Long-running jobs call this method periodically and stop when it returns true.
      Returns:
      true to request cancellation, false otherwise
      Since:
      2.0
    • subTask

      void subTask(String name)
      Notifies that a subtask of the job is beginning. Not every job has subtasks; when copying several files, for instance, copying each file can be a subtask.
      Parameters:
      name - the name (or description) of the subtask
      Since:
      2.0
    • worked

      void worked(int work)
      Notifies that a number of units of work have been completed. The number is an increment, not the total amount of work done so far.
      Parameters:
      work - a non-negative number of work units just completed
      Since:
      2.0