public class StoppableDelay extends Object implements Runnable
| Constructor and Description |
|---|
StoppableDelay(Runnable startRunnable,
Runnable stopRunnable)
Creates a new delay that runs the given runnable after 500 milliseconds.
|
StoppableDelay(Runnable startRunnable,
Runnable stopRunnable,
long delay)
Creates a new delay that runs the given runnable after the given number
of milliseconds.
|
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Marks the long-running operation as finished and runs the appropriate
runnable.
|
boolean |
isFinished()
Returns whether the long-running operation has finished.
|
void |
run() |
public StoppableDelay(Runnable startRunnable, Runnable stopRunnable)
startRunnable - The runnable that is run after the delaystopRunnable - The runnable that is run when the job finishespublic StoppableDelay(Runnable startRunnable, Runnable stopRunnable, long delay)
startRunnable - The runnable that is run after the delaystopRunnable - The runnable that is run when the job finishesdelay - The delay after which to display the dialog (in milliseconds)public boolean isFinished()
true if the operation is finishedpublic void finish()
startRunnable was not started yet, it will not
be started at all.Copyright © 2026. All rights reserved.