Package ghidra.util.task

# Class BufferedSwingRunner

java.lang.Object
ghidra.util.task.AbstractSwingUpdateManager
ghidra.util.task.BufferedSwingRunner

public class BufferedSwingRunner extends AbstractSwingUpdateManager
A class that run the client's runnable on the Swing thread. Repeated requests will get buffered until the max delay is reached.

- ## Field Summary

  ### Fields inherited from class ghidra.util.task.AbstractSwingUpdateManager

  `DEFAULT_MAX_DELAY, DEFAULT_MIN_DELAY, DEFAULT_NAME, isWorking, MIN_DELAY_FLOOR, NONE, timer`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BufferedSwingRunner()`
  `BufferedSwingRunner(int minDelay, int maxDelay)`
  Constructs a new SwingUpdateManager

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `run(Runnable r)`
  Runs the given runnable.
  `void`
  `runLater(Runnable r)`
  Runs the given runnable later, buffering the request until the timeout has expired.
  `protected void`
  `swingDoWork()`
  The subclass callback to perform work.

  ### Methods inherited from class ghidra.util.task.AbstractSwingUpdateManager

  `checkForWork, dispose, flush, hasPendingUpdates, isBusy, isDisposed, scheduleCheckForWork, stop, toString, toStringDebug, update, updateLater, updateNow`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BufferedSwingRunner

    public BufferedSwingRunner(int minDelay, int maxDelay)
    Constructs a new SwingUpdateManager

    Note: The `minDelay` will always be at least `AbstractSwingUpdateManager.MIN_DELAY_FLOOR`, regardless of the given value.

    Parameters:
      `minDelay` - the minimum number of milliseconds to wait once the event stream stops coming in before actually updating the screen.
      `maxDelay` - the maximum amount of time to wait between gui updates.

  - ### BufferedSwingRunner

    public BufferedSwingRunner()

- ## Method Details

  - ### swingDoWork

    protected void swingDoWork()
    Description copied from class: `AbstractSwingUpdateManager`
    The subclass callback to perform work.
    Specified by:
      `swingDoWork` in class `AbstractSwingUpdateManager`

  - ### run

    public void run(Runnable r)
    Runs the given runnable. If this is the first call to `run`, then do the work immediately; otherwise, buffer the request until the timeout has expired.

    See the header of `AbstractSwingUpdateManager` for details on the update process.

    Parameters:
      `r` - the task to run on the Swing thread

  - ### runLater

    public void runLater(Runnable r)
    Runs the given runnable later, buffering the request until the timeout has expired.

    See the header of `AbstractSwingUpdateManager` for details on the update process.

    Parameters:
      `r` - the task to run on the Swing thread