Class MultiProgressWorker
- All Implemented Interfaces:
Runnable
USAGE: Generally, you just need to extend this class and implement the run() method from the Runnable interface. Use the various fire...() methods to keep listeners up to date as to the status of your operation. Remember to end by invoking EITHER fireProgressComplete() or fireProgressCanceled()! Failure to fire one of these termination events will result in the progress dialog remaining open.
It is important to check for cancellation! The fireMajorProgressUpdate() and fireMinorProgressUpdate() methods return a boolean indicating whether the operation should continue. If any listener returns false, you should abort your operation as soon as possible and invoke fireProgressCanceled(). Failure to do so may result in the progress dialog remaining open indefinitely.
Reporting errors - If a recoverable error occurs during your operation, you can report it by invoking fireProgressError(). This will notify all listeners of the error. The listeners can then decide whether to continue or cancel the operation by returning true or false. If any listener returns false, you should abort your operation and invoke fireProgressCanceled().
- Since:
- swing-extras 1.6 (2022-05-10)
- Author:
- scorbo2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProgressListener(MultiProgressListener listener) voidprotected booleanfireMajorProgressUpdate(int majorStep, int totalMinorSteps, String message) booleanfireMinorProgressUpdate(int majorStep, int minorStep, String message) protected voidfireProgressBegins(int totalMajorSteps) voidvoidbooleanfireProgressError(String errorSource, String errorDetails) voidremoveProgressListener(MultiProgressListener listener)
-
Constructor Details
-
MultiProgressWorker
public MultiProgressWorker()
-
-
Method Details
-
addProgressListener
-
removeProgressListener
-
clearProgressListeners
public void clearProgressListeners() -
fireProgressBegins
protected void fireProgressBegins(int totalMajorSteps) -
fireMajorProgressUpdate
-
fireMinorProgressUpdate
-
fireProgressError
-
fireProgressComplete
public void fireProgressComplete() -
fireProgressCanceled
public void fireProgressCanceled()
-