Package ghidra.program.util
Class ProgramTask
- java.lang.Object
-
- ghidra.util.task.Task
-
- ghidra.program.util.ProgramTask
-
- All Implemented Interfaces:
MonitoredRunnable
- Direct Known Subclasses:
MoveBlockTask
public abstract class ProgramTask extends Task
Task for operating on programs. Will open and close a transaction around the work.
-
-
Field Summary
Fields Modifier and Type Field Description protected Program
program
-
Fields inherited from class ghidra.util.task.Task
taskMonitor, waitForTaskCompleted
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProgramTask(Program program, java.lang.String title, boolean canCancel, boolean hasProgress, boolean isModal)
Construct a new Task that will operate on a program.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doRun(TaskMonitor monitor)
void
run(TaskMonitor monitor)
This is the method that will be called to do the work-
Methods inherited from class ghidra.util.task.Task
addTaskListener, canCancel, cancel, getStatusTextAlignment, getTaskTitle, getWaitForTaskCompleted, hasProgress, isCancelled, isModal, monitoredRun, notifyTaskListeners, setHasProgress
-
-
-
-
Field Detail
-
program
protected Program program
-
-
Constructor Detail
-
ProgramTask
protected ProgramTask(Program program, java.lang.String title, boolean canCancel, boolean hasProgress, boolean isModal)
Construct a new Task that will operate on a program.- Parameters:
program
- the program that the task will operate on.title
- title the title associated with the taskcanCancel
- true means that the user can cancel the taskhasProgress
- true means that the dialog should show a progress indicatorisModal
- true means that the dialog is modal and the task has to complete or be canceled before any other action can occur
-
-
Method Detail
-
run
public final void run(TaskMonitor monitor)
Description copied from class:Task
This is the method that will be called to do the workNote: The run(TaskMonitor) method should not make any calls directly on Swing components, as these calls are not thread safe. Place Swing calls in a Runnable, then call
Swing.runLater(Runnable)
orSwing.runNow(Runnable)
to schedule the Runnable inside of the AWT Event Thread.
-
doRun
protected abstract void doRun(TaskMonitor monitor)
-
-