Package ghidra.app.util.task
Class OpenProgramTask
java.lang.Object
ghidra.util.task.Task
ghidra.app.util.task.OpenProgramTask
- All Implemented Interfaces:
MonitoredRunnable
Task for opening one or more programs.
-
Field Summary
Fields inherited from class ghidra.util.task.Task
taskMonitor, waitForTaskCompleted
-
Constructor Summary
ConstructorDescriptionOpenProgramTask
(ghidra.app.plugin.core.progmgr.ProgramLocator locator, Object consumer) Construct a task for opening a program.OpenProgramTask
(DomainFile domainFile, int version, Object consumer) Construct a task for opening a programOpenProgramTask
(DomainFile domainFile, Object consumer) Construct a task for opening the current version of a programOpenProgramTask
(URL ghidraURL, Object consumer) Construct a task for opening a program from a URLOpenProgramTask
(List<ghidra.app.plugin.core.progmgr.ProgramLocator> programLocatorList, Object consumer) Construct a task for opening one or more programs. -
Method Summary
Modifier and TypeMethodDescriptionGet the first successful open program requestGet all successful open program requestsvoid
run
(TaskMonitor monitor) This is the method that will be called to do the workvoid
Invoking this method prior to task execution will prevent the use of optional checkout which require prompting the user.void
setOpenPromptText
(String text) Sets the text to use for the base action type for various prompts that can appear when opening programs.void
Invoking this method prior to task execution will prevent any confirmation interaction with the user (e.g., optional checkout, snapshot recovery, etc.).Methods inherited from class ghidra.util.task.Task
addTaskListener, canCancel, cancel, getStatusTextAlignment, getTaskTitle, getWaitForTaskCompleted, hasProgress, isCancelled, isModal, monitoredRun, notifyTaskListeners, setHasProgress
-
Constructor Details
-
OpenProgramTask
public OpenProgramTask(List<ghidra.app.plugin.core.progmgr.ProgramLocator> programLocatorList, Object consumer) Construct a task for opening one or more programs.- Parameters:
programLocatorList
- the list of program locations to openconsumer
- the consumer to use for opening the programs
-
OpenProgramTask
Construct a task for opening a program.- Parameters:
locator
- the program location to openconsumer
- the consumer to use for opening the programs
-
OpenProgramTask
Construct a task for opening a program- Parameters:
domainFile
- theDomainFile
to openversion
- the version to open (versions other than the current version will be opened read-only)consumer
- the consumer to use for opening the programs
-
OpenProgramTask
Construct a task for opening the current version of a program- Parameters:
domainFile
- theDomainFile
to openconsumer
- the consumer to use for opening the programs
-
OpenProgramTask
Construct a task for opening a program from a URL- Parameters:
ghidraURL
- the URL to the program to be openedconsumer
- the consumer to use for opening the programs
-
-
Method Details
-
setOpenPromptText
Sets the text to use for the base action type for various prompts that can appear when opening programs. (The default is "Open".) For example, you may want to override this so be something like "Open Source", or "Open target".- Parameters:
text
- the text to use as the base action name.
-
setSilent
public void setSilent()Invoking this method prior to task execution will prevent any confirmation interaction with the user (e.g., optional checkout, snapshot recovery, etc.). Errors may still be displayed if they occur. -
setNoCheckout
public void setNoCheckout()Invoking this method prior to task execution will prevent the use of optional checkout which require prompting the user. -
getOpenPrograms
Get all successful open program requests- Returns:
- all successful open program requests
-
getOpenProgram
Get the first successful open program request- Returns:
- first successful open program request or null if none
-
run
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.
-