mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-3597 add methods to combine calling increment and checkCancelled, etc
Add methods to combine calling increment+checkCancelled andinitialize+setMessage
This commit is contained in:
@@ -88,6 +88,17 @@ public interface TaskMonitor {
|
|||||||
*/
|
*/
|
||||||
public void initialize(long max);
|
public void initialize(long max);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the progress value to 0, sets the max value and message of this monitor.
|
||||||
|
*
|
||||||
|
* @param max maximum value for progress
|
||||||
|
* @param message the message to display
|
||||||
|
*/
|
||||||
|
default public void initialize(long max, String message) {
|
||||||
|
initialize(max);
|
||||||
|
setMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the progress maximum value
|
* Set the progress maximum value
|
||||||
* <p><b>
|
* <p><b>
|
||||||
@@ -133,11 +144,41 @@ public interface TaskMonitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A convenience method to increment the current progress by the given value
|
* Increases the progress value by 1.
|
||||||
|
*/
|
||||||
|
default public void incrementProgress() {
|
||||||
|
incrementProgress(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the progress value by the specified amount.
|
||||||
|
*
|
||||||
* @param incrementAmount The amount by which to increment the progress
|
* @param incrementAmount The amount by which to increment the progress
|
||||||
*/
|
*/
|
||||||
public void incrementProgress(long incrementAmount);
|
public void incrementProgress(long incrementAmount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increases the progress value by 1, and checks if this monitor has been cancelled.
|
||||||
|
*
|
||||||
|
* @throws CancelledException if monitor has been cancelled
|
||||||
|
*/
|
||||||
|
default public void increment() throws CancelledException {
|
||||||
|
checkCancelled();
|
||||||
|
incrementProgress(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the progress value by the specified amount, and checks if this monitor has
|
||||||
|
* been cancelled.
|
||||||
|
*
|
||||||
|
* @param incrementAmount The amount by which to increment the progress
|
||||||
|
* @throws CancelledException if monitor has been cancelled
|
||||||
|
*/
|
||||||
|
default public void increment(long incrementAmount) throws CancelledException {
|
||||||
|
checkCancelled();
|
||||||
|
incrementProgress(incrementAmount);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current progress value or {@link #NO_PROGRESS_VALUE} if there is no value set
|
* Returns the current progress value or {@link #NO_PROGRESS_VALUE} if there is no value set
|
||||||
* @return the current progress value or {@link #NO_PROGRESS_VALUE} if there is no value set
|
* @return the current progress value or {@link #NO_PROGRESS_VALUE} if there is no value set
|
||||||
|
|||||||
Reference in New Issue
Block a user