Merge remote-tracking branch 'origin/patch'

This commit is contained in:
ghidra1 2022-01-10 20:52:42 -05:00
commit 273fe030cb
10 changed files with 161 additions and 147 deletions

View file

@ -17,20 +17,15 @@ package ghidra.framework.cmd;
import ghidra.framework.model.DomainObject;
import ghidra.util.task.TaskMonitor;
import ghidra.util.task.TaskMonitorAdapter;
/**
* Abstract command that will be run in a thread (in the background)
* other than the AWT(GUI) thread. Use this to apply a long running
* command that is interruptable.
*
* The monitor allows the command to display status information as it
* executes.
*
* This allows commands to make changes in the background so that the
* GUI is not frozen and the user can still interact with the GUI.
* Abstract command that will be run in a thread (in the background) other than the AWT(GUI)
* thread. Use this to apply a long running command that is cancellable.
*
* <p>The monitor allows the command to display status information as it executes.
*
* <p>This allows commands to make changes in the background so that the GUI is not frozen and the
* user can still interact with the GUI.
*/
public abstract class BackgroundCommand implements Command {
@ -51,22 +46,17 @@ public abstract class BackgroundCommand implements Command {
this.isModal = isModal;
}
/*
* @see ghidra.framework.cmd.Command#applyTo(ghidra.framework.model.DomainObject)
*/
@Override
public final boolean applyTo(DomainObject obj) {
return applyTo(obj, TaskMonitorAdapter.DUMMY_MONITOR);
return applyTo(obj, TaskMonitor.DUMMY);
}
/**
* Method called when this command is to apply changes to the
* given domain object. A monitor is provided to display status
* information about the command as it executes in the background.
* Method called when this command is to apply changes to the given domain object. A monitor
* is provided to display status information about the command as it executes in the background.
*
* @param obj domain object that will be affected by the command
* @param monitor monitor to show progress of the command
*
* @return true if the command applied successfully
*/
public abstract boolean applyTo(DomainObject obj, TaskMonitor monitor);