Package ghidra.framework.plugintool
Enum Class PluginToolUtils
- All Implemented Interfaces:
Serializable,Comparable<PluginToolUtils>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetServiceFromRunningCompatibleTool(PluginTool tool, Class<T> serviceClass) Get the service for the given class from the most recent tool having itstatic <T> TinRunningToolsPreferringActive(PluginTool tool, Function<? super PluginTool, ? extends T> action) Attempts the given action in all running tools, starting with the active one, if applicablestatic PluginToolopenInMostRecentOrLaunchedCompatibleTool(PluginTool tool, DomainFile domainFile) Opens the given domain file in the most recent tool which can accept it, or it launches a new tool to accept itstatic PluginToolUtilsReturns the enum constant of this class with the specified name.static PluginToolUtils[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
inRunningToolsPreferringActive
public static <T> T inRunningToolsPreferringActive(PluginTool tool, Function<? super PluginTool, ? extends T> action) Attempts the given action in all running tools, starting with the active one, if applicableThis will stop once the given action returns a non-null result, and return that result.
- Type Parameters:
T- the type of result- Parameters:
tool- the front-end tool, whose running plugin tools to tryaction- the action to apply to each plugin tool- Returns:
- the first non-null result of the action, or null if all plugin tools were exhausted
-
openInMostRecentOrLaunchedCompatibleTool
public static PluginTool openInMostRecentOrLaunchedCompatibleTool(PluginTool tool, DomainFile domainFile) Opens the given domain file in the most recent tool which can accept it, or it launches a new tool to accept itTODO: This currently fails in the "most-recent" aspect if a non-compatible tool has focus. In that case, it'll pick any compatible tool, no matter how recently it had focus.
- Parameters:
tool- the front-end tooldomainFile- the domain file to open (may not be null)- Returns:
- the (possibly new) plugin tool which accepted the domain file
-
getServiceFromRunningCompatibleTool
Get the service for the given class from the most recent tool having itTODO: This currently fails in the "most-recent" aspect if a non-compatible tool has focus. In that case, it'll pick any compatible tool, no matter how recently it had focus.
- Type Parameters:
T- the type of the service- Parameters:
tool- the front-end toolserviceClass- the class of the service- Returns:
- the found service, or
nullif no running tool has it
-