Interface ProgressReceiver

All Known Implementing Classes:
SubProgressReceiver, TextProgressReceiver

public interface ProgressReceiver
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Indicates that the operation should be aborted, for instance because the user has requested that it be cancelled, or because an error has occurred.
    static class 
    Indicates that the operation should be aborted because the user has requested that it be cancelled.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Check whether the operation has been canceled.
    void
    Report that the operation has succeeded successfully.
    void
    Report that the operation has been aborted due to an exception having been thrown.
    void
    Restart the progress bar.
    void
    setMessage(String message)
    Change the message describing the current operation.
    void
    setProgress(float progress)
    Set the progress as a value from 0.0f to 1.0f (inclusive).
    void
    Invoked when a subordinate SubProgressReceiver is started, reporting to this progress receiver.
  • Method Details

    • setProgress

      void setProgress(float progress) throws ProgressReceiver.OperationCancelled
      Set the progress as a value from 0.0f to 1.0f (inclusive).
      Parameters:
      progress - The progress to report.
      Throws:
      ProgressReceiver.OperationCancelled - If the operation has been canceled, for instance by the user, or because of an exception on another thread.
    • exceptionThrown

      void exceptionThrown(Throwable exception)
      Report that the operation has been aborted due to an exception having been thrown. Any other threads working on the same operation will be canceled.
      Parameters:
      exception - The exception which has been thrown.
    • done

      void done()
      Report that the operation has succeeded successfully.
    • setMessage

      void setMessage(String message) throws ProgressReceiver.OperationCancelled
      Change the message describing the current operation.
      Parameters:
      message - A message describing the current operation.
      Throws:
      ProgressReceiver.OperationCancelled - If the operation has been canceled, for instance by the user, or because of an exception on another thread.
    • checkForCancellation

      void checkForCancellation() throws ProgressReceiver.OperationCancelled
      Check whether the operation has been canceled. An OperationCancelled exception will be thrown if it has.
      Throws:
      ProgressReceiver.OperationCancelled - If the operation has been canceled, for instance by the user, or because of an exception on another thread.
    • reset

      Restart the progress bar. All progress will be wiped out and the next expected progress report will be expected to be as if progress started from 0.0f again.
      Throws:
      ProgressReceiver.OperationCancelled - If the operation has been canceled, for instance by the user, or because of an exception on another thread.
    • subProgressStarted

      void subProgressStarted(SubProgressReceiver subProgressReceiver) throws ProgressReceiver.OperationCancelled
      Invoked when a subordinate SubProgressReceiver is started, reporting to this progress receiver.
      Parameters:
      subProgressReceiver - The sub progress receiver which has been started.
      Throws:
      ProgressReceiver.OperationCancelled - If the operation has been canceled, for instance by the user, or because of an exception on another thread.