Package ghidra.framework.model
Interface ToolChest
public interface ToolChest
Interface to define methods to manage tools in a central location.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener to be notified when the tool chest is changed.boolean
addToolTemplate
(ToolTemplate template) Add tool template to the tool chest.int
Get the number of tools in this tool chest.getToolTemplate
(String toolName) Get the tool template for the given tool name.Get the tool templates from the tool chest.boolean
Remove entry (toolTemplate or toolSet) from the tool chest.void
Remove a listener that is listening to when the tool chest is changed.boolean
replaceToolTemplate
(ToolTemplate template) Performs the same action as callingremove(String)
and thenaddToolTemplate(ToolTemplate)
.
-
Method Details
-
getToolTemplate
Get the tool template for the given tool name.- Parameters:
toolName
- name of tool- Returns:
- null if there is no tool template for the given toolName.
-
getToolTemplates
ToolTemplate[] getToolTemplates()Get the tool templates from the tool chest.- Returns:
- list of tool template
-
addToolChestChangeListener
Add a listener to be notified when the tool chest is changed.- Parameters:
l
- listener to add
-
removeToolChestChangeListener
Remove a listener that is listening to when the tool chest is changed.- Parameters:
l
- to remove
-
addToolTemplate
Add tool template to the tool chest.
Note: If the given tool template name already exists in the project, then the name will be altered by appending an underscore and a one-up value. Thetemplate
parameter's name is also updated with then new name.To simply replace a tool with without changing its name, call
replaceToolTemplate(ToolTemplate)
- Parameters:
template
- tool template to add
-
remove
Remove entry (toolTemplate or toolSet) from the tool chest.- Parameters:
toolName
- name of toolConfig or toolSet to remove- Returns:
- true if the toolConfig or toolset was successfully removed from the tool chest.
-
getToolCount
int getToolCount()Get the number of tools in this tool chest.- Returns:
- tool count.
-
replaceToolTemplate
Performs the same action as callingremove(String)
and thenaddToolTemplate(ToolTemplate)
. However, calling this method prevents state from being lost in the transition, such as position in the tool chest and default tool status.- Parameters:
template
- The template to add to the tool chest, replacing any tools with the same name.- Returns:
- True if the template was added.
-