Package org.pepsoft.util
Interface ProgressReceiver
- All Known Implementing Classes:
SubProgressReceiver,TextProgressReceiver
public interface ProgressReceiver
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classIndicates that the operation should be aborted, for instance because the user has requested that it be cancelled, or because an error has occurred.static classIndicates that the operation should be aborted because the user has requested that it be cancelled. -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck whether the operation has been canceled.voiddone()Report that the operation has succeeded successfully.voidexceptionThrown(Throwable exception) Report that the operation has been aborted due to an exception having been thrown.voidreset()Restart the progress bar.voidsetMessage(String message) Change the message describing the current operation.voidsetProgress(float progress) Set the progress as a value from 0.0f to 1.0f (inclusive).voidsubProgressStarted(SubProgressReceiver subProgressReceiver) Invoked when a subordinateSubProgressReceiveris started, reporting to this progress receiver.
-
Method Details
-
setProgress
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
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
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
Check whether the operation has been canceled. AnOperationCancelledexception 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 subordinateSubProgressReceiveris 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.
-