Package ghidra.framework.model
Interface Project
-
- All Known Implementing Classes:
DefaultProject
public interface Project
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProjectData
addProjectView(java.net.URL projectURL)
Add the given project URL to this project's list project views.void
close()
Close the project.ToolChest
getLocalToolChest()
Return the local tool chest for the user logged in.java.lang.String
getName()
Convenience method to get the name of this project.java.util.List<DomainFile>
getOpenData()
Get list of domain files that are open.ProjectData
getProjectData()
Get the root domain data folder in the project.ProjectData
getProjectData(ProjectLocator projectLocator)
Returns the Project Data for the given Project locator.ProjectData
getProjectData(java.net.URL url)
Returns the Project Data for the given Project URL.ProjectLocator
getProjectLocator()
Get the project locator for this project.ProjectManager
getProjectManager()
Returns the project manager of this project.ProjectLocator[]
getProjectViews()
Return the list of project views in this project.RepositoryAdapter
getRepository()
Get the repository that this project is associated with.SaveState
getSaveableData(java.lang.String key)
The analog forsetSaveableData(String, SaveState)
.ToolManager
getToolManager()
Return the tool manager for this project.ToolServices
getToolServices()
Return the tool services for this project.ToolTemplate
getToolTemplate(java.lang.String tag)
Get the tool template with the given tag.ProjectData[]
getViewedProjectData()
Get the project data for other projects that are currently being viewed.boolean
hasChanged()
Return whether the project configuration has changed.boolean
isClosed()
Returns whether this project instance has been closedvoid
releaseFiles(java.lang.Object consumer)
Releases all DomainObjects used by the given consumervoid
removeProjectView(java.net.URL projectURL)
Remove the project view from this project.void
restore()
Restore this project's state.void
save()
Save the project and the list of project views.boolean
saveSessionTools()
Saves any tools that are associated with the opened project when the project is closed.void
saveToolTemplate(java.lang.String tag, ToolTemplate template)
Save the given tool template as part of the project.void
setSaveableData(java.lang.String key, SaveState saveState)
Allows the user to store data related to the project.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Convenience method to get the name of this project.
-
getProjectLocator
ProjectLocator getProjectLocator()
Get 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()
Return the tool manager for this project.
-
getToolServices
ToolServices getToolServices()
Return the tool services for this project.
-
hasChanged
boolean hasChanged()
Return whether the project configuration has changed.
-
isClosed
boolean isClosed()
Returns whether this project instance has been closed
-
getLocalToolChest
ToolChest getLocalToolChest()
Return 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
ProjectData addProjectView(java.net.URL projectURL) throws java.io.IOException, java.net.MalformedURLException
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.- Parameters:
projectURL
- identifier for the project view- Returns:
- project data for this view
- Throws:
java.io.IOException
- if I/O error occurs or if project/repository not foundjava.net.MalformedURLException
- if projectURL is invalid
-
removeProjectView
void removeProjectView(java.net.URL projectURL)
Remove the project view from this project.- Parameters:
projectURL
- identifier for the project
-
getProjectViews
ProjectLocator[] getProjectViews()
Return the list of project views in this project.
-
close
void close()
Close the project.
-
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
void saveToolTemplate(java.lang.String tag, ToolTemplate template)
Save the given tool template as part of the project.- Parameters:
tag
- ID or name for the tool templatetemplate
- template to save
-
getToolTemplate
ToolTemplate getToolTemplate(java.lang.String tag)
Get the tool template with the given tag.- Parameters:
tag
- ID or name for the tool template to get- Returns:
- tool template
-
setSaveableData
void setSaveableData(java.lang.String key, SaveState saveState)
Allows the user to store data related to the project.- Parameters:
key
- A value used to store and lookup saved datasaveState
- a container of data that will be written out when persisted
-
getSaveableData
SaveState getSaveableData(java.lang.String key)
The analog forsetSaveableData(String, SaveState)
.
-
getOpenData
java.util.List<DomainFile> getOpenData()
Get list of domain files that are open.- Returns:
- the files; empty if no files
-
getProjectData
ProjectData getProjectData()
Get the root domain data folder in the project.
-
getProjectData
ProjectData getProjectData(ProjectLocator projectLocator)
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.
-
getProjectData
ProjectData getProjectData(java.net.URL url)
Returns the Project Data for the given Project URL. The Project URL must correspond to the current active project or an currently open project view.
-
getViewedProjectData
ProjectData[] getViewedProjectData()
Get the project data for other projects that are currently being viewed.- Returns:
- zero length array if there are no viewed projects open
-
releaseFiles
void releaseFiles(java.lang.Object consumer)
Releases all DomainObjects used by the given consumer- Parameters:
consumer
- object no longer using any DomainObjects.
-
-