Package ghidra.framework.model
Interface Project
- All Superinterfaces:
AutoCloseable,Iterable<DomainFile>
- All Known Implementing Classes:
DefaultProject,PyGhidraProject
Interface to define methods to manage data and tools for users working on a
particular effort. Project represents the container object for users, data,
and tools to work together.
-
Method Summary
Modifier and TypeMethodDescriptionaddProjectView(URL projectURL, boolean visible) Add the given project URL to this project's list project views.voidaddProjectViewListener(ProjectViewListener listener) Add a listener to be notified when a visible project view is added or removed.voidclose()Close the project.Returns the local tool chest for the user logged in.getName()Returns the name of this project.Get list of domain files that are open.Returns the root domain data folder in the project.getProjectData(ProjectLocator projectLocator) Returns the Project Data for the given Project locator.getProjectData(URL projectURL) Returns the Project Data for the given Project URL.Returns the project locator for this project.Returns the project manager of this project.Returns the list of visible project views in this project.Get the repository that this project is associated with.getSaveableData(String key) Returns the user data previously stored to the project.Returns the tool manager for this project.Returns the tool services for this project.getToolTemplate(String tag) Get the tool template with the given tag.Get the project data for visible viewed projects that are managed by this project.booleanReturns whether the project configuration has changed.booleanisClosed()Returns whether this project instance has been closed.default Iterator<DomainFile> iterator()Return aDomainFileiterator over all non-link files within this project's data store.voidreleaseFiles(Object consumer) Releases all DomainObjects used by the given consumervoidremoveProjectView(URL projectURL) Remove the project view from this project.voidremoveProjectViewListener(ProjectViewListener listener) Remove a project view listener previously added.voidrestore()Restore this project's state.voidsave()Save the project and the list of project views.booleanSaves any tools that are associated with the opened project when the project is closed.voidsaveToolTemplate(String tag, ToolTemplate template) Save the given tool template as part of the project.voidsetSaveableData(String key, SaveState saveState) Allows the user to store data related to the project.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getName
String getName()Returns the name of this project.- Returns:
- the name of this project
-
getProjectLocator
ProjectLocator getProjectLocator()Returns the project locator for this project.- Returns:
- the project locator for this project
-
getProjectManager
ProjectManager getProjectManager()Returns the project manager of this project.- Returns:
- the project manager of this project
-
getToolManager
ToolManager getToolManager()Returns the tool manager for this project.- Returns:
- the tool manager for this project
-
getToolServices
ToolServices getToolServices()Returns the tool services for this project.- Returns:
- the tool services for this project
-
hasChanged
boolean hasChanged()Returns whether the project configuration has changed.- Returns:
- whether the project configuration has changed
-
isClosed
boolean isClosed()Returns whether this project instance has been closed.- Returns:
- whether this project instance has been closed
-
getLocalToolChest
ToolChest getLocalToolChest()Returns the local tool chest for the user logged in.- Returns:
- the local tool chest for the user logged in
-
getRepository
RepositoryAdapter getRepository()Get the repository that this project is associated with.- Returns:
- null if the project is not associated with a remote repository
-
addProjectView
Add the given project URL to this project's list project views. The project view allows users to look at data files from another project. If the URL corresponds to this project its ProjectData will be returned.- Parameters:
projectURL- identifier for the project view (ghidra protocol only).visible- true if project may be made visible or false if hidden. Hidden viewed projects are used when only life-cycle management is required (e.g., close view project when this project is closed).- Returns:
- project data for this view
- Throws:
IOException- if this project is closed, an invalid URL is specified, or failed to open/connect to project/repository.
-
removeProjectView
Remove the project view from this project.- Parameters:
projectURL- identifier for the project
-
getProjectViews
ProjectLocator[] getProjectViews()Returns the list of visible project views in this project.- Returns:
- the list of visible project views in this project
-
close
void close()Close the project.- Specified by:
closein interfaceAutoCloseable
-
save
void save()Save the project and the list of project views. -
saveSessionTools
boolean saveSessionTools()Saves any tools that are associated with the opened project when the project is closed.- Returns:
- True if the save was not cancelled.
-
restore
void restore()Restore this project's state. -
saveToolTemplate
Save the given tool template as part of the project.- Parameters:
tag- ID or name for the tool templatetemplate- template to save
-
getToolTemplate
Get the tool template with the given tag.- Parameters:
tag- ID or name for the tool template to get- Returns:
- tool template
-
setSaveableData
Allows the user to store data related to the project. SeegetSaveableData(String)for future retieval of data.- Parameters:
key- a value used to store and lookup saved datasaveState- a container of data that will be written out when persisted
-
getSaveableData
Returns the user data previously stored to the project. SeesetSaveableData(String, SaveState).- Parameters:
key- a value used to store and lookup saved data- Returns:
- the user data previously stored to the project
-
getOpenData
List<DomainFile> getOpenData()Get list of domain files that are open.- Returns:
- the files; empty if no files
-
getProjectData
ProjectData getProjectData()Returns the root domain data folder in the project.- Returns:
- the root domain data folder in the project
-
getProjectData
Returns the Project Data for the given Project locator. The Project locator must be either the current active project or an currently open project view. The returned view may not be visible.- Parameters:
projectLocator- project locator object used to open project- Returns:
- requested project data
-
getProjectData
Returns the Project Data for the given Project URL. The Project URL must be either the current active project or a currently open project view. The returned view may not be visible.- Parameters:
projectURL- identifier for the project view (ghidra protocol only).- Returns:
- project data for this view or null
-
getViewedProjectData
ProjectData[] getViewedProjectData()Get the project data for visible viewed projects that are managed by this project.- Returns:
- zero length array if there are no visible viewed projects open
-
releaseFiles
Releases all DomainObjects used by the given consumer- Parameters:
consumer- object no longer using any DomainObjects.
-
addProjectViewListener
Add a listener to be notified when a visible project view is added or removed.- Parameters:
listener- project view listener
-
removeProjectViewListener
Remove a project view listener previously added.- Parameters:
listener- project view listener
-
iterator
Return aDomainFileiterator over all non-link files within this project's data store. If links should be followed use an appropropriate static method fromProjectDataUtils.- Specified by:
iteratorin interfaceIterable<DomainFile>- Returns:
- domain file iterator
-