Package ghidra.framework.main
Class GetDomainObjectTask
java.lang.Object
ghidra.util.task.Task
ghidra.framework.main.GetDomainObjectTask
- All Implemented Interfaces:
MonitoredRunnable
A modal task that gets a domain object for a specified version.
Object is either open read-only or immutable.
NOTE: This task is not intended to open a domain file for modification and saving back
to a project.
A file open for read-only use will be upgraded if needed and is possible. Once open it is
important that the specified consumer be released from the domain object when done using
the open object (see
DomainObject.release(Object)
).-
Field Summary
Fields inherited from class ghidra.util.task.Task
taskMonitor, waitForTaskCompleted
-
Constructor Summary
ConstructorDescriptionGetDomainObjectTask
(Object consumer, DomainFile domainFile, int versionNumber) Construct task open specified domainFile read only.GetDomainObjectTask
(Object consumer, DomainFile domainFile, int versionNumber, boolean immutable) Construct task open specified domainFile read only or immutable. -
Method Summary
Modifier and TypeMethodDescriptionReturn the domain object instance.void
run
(TaskMonitor monitor) This is the method that will be called to do the workMethods inherited from class ghidra.util.task.Task
addTaskListener, canCancel, cancel, getStatusTextAlignment, getTaskTitle, getWaitForTaskCompleted, hasProgress, isCancelled, isModal, monitoredRun, notifyTaskListeners, setHasProgress
-
Constructor Details
-
GetDomainObjectTask
Construct task open specified domainFile read only. An upgrade is performed if needed and is possible.- Parameters:
consumer
- consumer of the domain objectdomainFile
- domain fileversionNumber
- version
-
GetDomainObjectTask
public GetDomainObjectTask(Object consumer, DomainFile domainFile, int versionNumber, boolean immutable) Construct task open specified domainFile read only or immutable. Immutable mode should not be used for content that will be modified. If read-only an upgrade is performed if needed, if immutable the user will be prompted if an upgrade should be performed if possible in which case it will open read-only.- Parameters:
consumer
- consumer of the domain objectdomainFile
- domain fileversionNumber
- versionimmutable
- true if the object should be open immutable, else read-only.
-
-
Method Details
-
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. -
getDomainObject
Return the domain object instance.- Returns:
- domain object which was opened or null if task cancelled or failed
-