Package ghidra.framework.project.tool
Class GhidraTool
- java.lang.Object
-
- docking.AbstractDockingTool
-
- ghidra.framework.plugintool.PluginTool
-
- ghidra.framework.project.tool.GhidraTool
-
- All Implemented Interfaces:
DockingTool,Tool,ToolListener,ServiceProvider
- Direct Known Subclasses:
TestTool
public class GhidraTool extends PluginTool
Tool created by the workspace when the user chooses to create a new tool. Its ToolConfigProvider shows all Plugins with the exception of those plugins that can be added to the Front End tool only.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanautoSavestatic java.lang.StringEXTENSIONS_PREFERENCE_NAME-
Fields inherited from class ghidra.framework.plugintool.PluginTool
extensionTableProvider, iconURL, isDisposed, manageDialog, toolName
-
Fields inherited from class docking.AbstractDockingTool
configChangedFlag, optionsMap, toolActions, winMgr
-
Fields inherited from interface ghidra.framework.model.Tool
DESCRIPTION_PROPERTY_NAME, ICON_PROPERTY_NAME, PLUGIN_COUNT_PROPERTY_NAME, TOOL_NAME_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description GhidraTool(Project project, GhidraToolTemplate template)Construct a new GhidraTool using an existing template.GhidraTool(Project project, java.lang.String name)Construct a new Ghidra Tool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddManagePluginsAction()voidcheckForNewExtensions()Looks for extensions that have been installed since the last time this tool was launched.protected DockingWindowManagercreateDockingWindowManager(boolean isDockable, boolean hasStatus, boolean isModal)This method exists here, as opposed to inline in the constructor, so that subclasses can alter the behavior of the DockingWindowManager construction.protected booleandoSaveTool()Called when it is time to save the tool.voidexit()Tells the tool to stop functioning and release its resources.PluginClassManagergetPluginClassManager()ToolTemplategetToolTemplate(boolean includeConfigState)Returns a ToolTemplate for this Tool that describes the state of the tool.protected voidinitActions()Placeholder for subclasses to get a chance to install actions before plugins.voidrestoreWindowingDataFromXml(org.jdom.Element windowData)Restores the tool's Docking Window layout and positioning information from an XML element.org.jdom.ElementsaveWindowingDataToXml()Saves the tool's Docking Window layout and positioning information to an XML element.voidsetToolName(java.lang.String name)Sets the type name of the tool.booleanshouldSave()Returns true if this tool should save its data, based upon its changed state and the state of Ghidra's saving method.protected voidshowConfig()-
Methods inherited from class ghidra.framework.plugintool.PluginTool
acceptDomainFiles, addExitAction, addExportToolAction, addHelpActions, addListenerForAllPluginEvents, addOptionsAction, addPlugin, addPlugin, addPlugins, addPropertyChangeListener, addSaveToolAction, addServiceListener, addStatusComponent, addToolListener, beep, cancelCurrentTask, canClose, canCloseDomainFile, canCloseDomainObject, clearLastEvents, close, dispose, execute, execute, execute, executeBackgroundCommand, firePluginEvent, getActiveComponentProvider, getActiveWindow, getConsumedToolEventNames, getDomainFiles, getIcon, getIconURL, getInstanceName, getLocation, getManagedPlugins, getManagePluginsDialog, getName, getOptions, getOptions, getProject, getProjectManager, getService, getServices, getSize, getSupportedDataTypes, getToolEventNames, getToolName, getToolServices, getTransientState, getUndoRedoToolState, hasOptions, hasToolListeners, hasUnsavedData, installHomeButton, isConfigurable, isExecutingCommand, isService, isWindowsOnTop, optionsChanged, prepareToSave, processToolEvent, putInstanceName, refreshKeybindings, registerOptionsNameChange, removeListenerForAllPluginEvents, removePlugins, removePreferenceState, removePropertyChangeListener, removeServiceListener, removeStatusComponent, removeToolListener, restoreDataStateFromXml, restoreFromXml, restoreOptionsFromXml, restorePluginsFromXml, saveDataStateToXml, saveTool, saveToolAs, saveToolToToolTemplate, saveToXml, scheduleFollowOnCommand, setConfigChanged, setDefaultComponent, setIconURL, setLocation, setProject, setSize, setSubTitle, setUnconfigurable, setWindowsOnTop, showComponentHeader, showConfig, showDialog, showDialog, showDialogOnActiveWindow, showEditWindow, showExtensions, terminateBackgroundCommands, threadIsBackgroundTaskThread
-
Methods inherited from class docking.AbstractDockingTool
addAction, addComponentProvider, addContextListener, addLocalAction, addPopupActionProvider, clearStatusInfo, contextChanged, getAllActions, getComponentProvider, getDockingActionsByOwnerName, getGlobalContext, getProviderWindow, getToolActions, getToolFrame, getWindowManager, hasConfigChanged, isActive, isVisible, isVisible, removeAction, removeComponentProvider, removeContextListener, removeLocalAction, removePopupActionProvider, setMenuGroup, setMenuGroup, setStatusInfo, setStatusInfo, setVisible, showComponentProvider, showDialog, toFront, toFront, updateTitle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface docking.DockingTool
addAction, addComponentProvider, addContextListener, addLocalAction, addPopupActionProvider, clearStatusInfo, contextChanged, getAllActions, getComponentProvider, getDockingActionsByOwnerName, getGlobalContext, getProviderWindow, getToolActions, getWindowManager, hasConfigChanged, isActive, isVisible, isVisible, removeAction, removeComponentProvider, removeContextListener, removeLocalAction, removePopupActionProvider, setMenuGroup, setStatusInfo, setStatusInfo, setVisible, showComponentProvider, showDialog, toFront, toFront, updateTitle
-
-
-
-
Field Detail
-
EXTENSIONS_PREFERENCE_NAME
public static final java.lang.String EXTENSIONS_PREFERENCE_NAME
- See Also:
- Constant Field Values
-
autoSave
public static boolean autoSave
-
-
Constructor Detail
-
GhidraTool
public GhidraTool(Project project, java.lang.String name)
Construct a new Ghidra Tool.- Parameters:
project- the project associated with the toolname- the name of the tool
-
GhidraTool
public GhidraTool(Project project, GhidraToolTemplate template)
Construct a new GhidraTool using an existing template.- Parameters:
project- project that is the associated with the tool.template- the template to use when creating the tool
-
-
Method Detail
-
createDockingWindowManager
protected DockingWindowManager createDockingWindowManager(boolean isDockable, boolean hasStatus, boolean isModal)
Description copied from class:PluginToolThis method exists here, as opposed to inline in the constructor, so that subclasses can alter the behavior of the DockingWindowManager construction.- Overrides:
createDockingWindowManagerin classPluginTool- Parameters:
isDockable- true if the tool contains components that can be dockedhasStatus- true if the tool should display a status componentisModal- true if the tool is modal, meaning that while this tool is visible, no other tool or dialog in Ghidra can have focus- Returns:
- a new DockingWindowManager
-
initActions
protected void initActions()
Description copied from class:PluginToolPlaceholder for subclasses to get a chance to install actions before plugins.- Overrides:
initActionsin classPluginTool
-
getPluginClassManager
public PluginClassManager getPluginClassManager()
- Specified by:
getPluginClassManagerin classPluginTool
-
setToolName
public void setToolName(java.lang.String name)
Description copied from interface:ToolSets the type name of the tool.- Specified by:
setToolNamein interfaceTool- Overrides:
setToolNamein classPluginTool- Parameters:
name- the basename to use when setting the tool's name
-
getToolTemplate
public ToolTemplate getToolTemplate(boolean includeConfigState)
Description copied from interface:ToolReturns a ToolTemplate for this Tool that describes the state of the tool.- Specified by:
getToolTemplatein interfaceTool- Overrides:
getToolTemplatein classPluginTool- Returns:
- a ToolTemplate for this Tool that describes the state of the tool.
-
saveWindowingDataToXml
public org.jdom.Element saveWindowingDataToXml()
Description copied from interface:ToolSaves the tool's Docking Window layout and positioning information to an XML element.- Specified by:
saveWindowingDataToXmlin interfaceTool- Overrides:
saveWindowingDataToXmlin classPluginTool- Returns:
- the element containing the DockingWindow's layout information.
-
restoreWindowingDataFromXml
public void restoreWindowingDataFromXml(org.jdom.Element windowData)
Description copied from interface:ToolRestores the tool's Docking Window layout and positioning information from an XML element.- Specified by:
restoreWindowingDataFromXmlin interfaceTool- Overrides:
restoreWindowingDataFromXmlin classPluginTool- Parameters:
windowData- the element containing the information.
-
shouldSave
public boolean shouldSave()
Description copied from interface:ToolReturns true if this tool should save its data, based upon its changed state and the state of Ghidra's saving method.- Specified by:
shouldSavein interfaceTool- Overrides:
shouldSavein classPluginTool- Returns:
- true if this tool should save its data
-
doSaveTool
protected boolean doSaveTool()
Description copied from class:PluginToolCalled when it is time to save the tool. Handles auto-saving logic.- Overrides:
doSaveToolin classPluginTool- Returns:
- true if a save happened
-
exit
public void exit()
Description copied from interface:ToolTells the tool to stop functioning and release its resources. The tool should dispose of all its windows and other resources.- Specified by:
exitin interfaceTool- Overrides:
exitin classPluginTool
-
addManagePluginsAction
protected void addManagePluginsAction()
-
showConfig
protected void showConfig()
-
checkForNewExtensions
public void checkForNewExtensions()
Looks for extensions that have been installed since the last time this tool was launched. If any are found, and if those extensions contain plugins, the user is notified and given the chance to install them.
-
-