Package org.ka2ddo.yaac.core
Interface StatusListener
- All Known Implementing Classes:
ProgressDialog
public interface StatusListener
This interface defines something that can display the current status of an ongoing
long-running operation.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether the user has requested that the long-running operation be aborted.boolean
Test whether the operation monitored by this StatusListener is done.void
setAbortListener
(AbortListener abortListener) Register an asynchronous callback to indicate the user requested cancellation.void
Report that the long-running operation is done.void
show()
Make a modal StatusListener visible.void
updateMessage
(String msg) Update the status message for this operation.void
updateProgress
(double percent) Update the progress percentage for this operation.void
updateStatus
(String msg, double percent) Update the status message and progress percentage for this operation.void
updateStatusSynchronously
(String msg, double percent) Update the status message and progress percentage for this operation, blocking until the GUI is updated.
-
Method Details
-
setAbortListener
Register an asynchronous callback to indicate the user requested cancellation.- Parameters:
abortListener
- AbortListener to call from UI thread when cancellation is requested, or null to remove cancellation callback object
-
updateMessage
Update the status message for this operation.- Parameters:
msg
- String message to display- Throws:
UserAbort
- if user wants to stop long-running operation
-
updateProgress
Update the progress percentage for this operation.- Parameters:
percent
- percent complete in the range 0 to 100.- Throws:
UserAbort
- if user wants to stop long-running operation
-
updateStatus
Update the status message and progress percentage for this operation.- Parameters:
msg
- String message to displaypercent
- percent complete in the range 0 to 100.- Throws:
UserAbort
- if user wants to stop long-running operation
-
updateStatusSynchronously
Update the status message and progress percentage for this operation, blocking until the GUI is updated.- Parameters:
msg
- String message to displaypercent
- percent complete in the range 0 to 100.- Throws:
UserAbort
- if user wants to stop long-running operation
-
setOperationComplete
void setOperationComplete()Report that the long-running operation is done. -
isOperationComplete
boolean isOperationComplete()Test whether the operation monitored by this StatusListener is done. Used to allow one thread to test the result of another thread's execution.- Returns:
- boolean true if operation has been reported complete
-
isAborted
boolean isAborted()Test whether the user has requested that the long-running operation be aborted. This is useful so that threads other than the one that received a UserAbort exception can also clean up.- Returns:
- boolean true if operation has been aborted by user
-
show
void show()Make a modal StatusListener visible.
-