mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-4269 - Minor refactor of plugin category names
This commit is contained in:
parent
fbdc01c33a
commit
ca9cfe9f9a
63 changed files with 204 additions and 287 deletions
|
@ -15,26 +15,33 @@
|
|||
*/
|
||||
package ghidra.app.plugin;
|
||||
|
||||
import ghidra.framework.main.ApplicationLevelPlugin;
|
||||
import ghidra.framework.plugintool.util.PluginDescription;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
|
||||
/**
|
||||
* A listing of commonly used {@link PluginDescription} category names.
|
||||
* <p>
|
||||
* Note - the Front End tool automatically include plugins that: 1) implement
|
||||
* {@link ApplicationLevelPlugin}, have the {@link PluginStatus#RELEASED}, and do not have the
|
||||
* {@link #EXAMPLES} category. If you wish to create an {@link ApplicationLevelPlugin} that is not
|
||||
* automatically included in the Front End, the easiest way to do that is to mark its status as
|
||||
* {@link PluginStatus#STABLE}.
|
||||
*/
|
||||
public interface PluginCategoryNames {
|
||||
String COMMON = GenericPluginCategoryNames.COMMON;
|
||||
String SUPPORT = GenericPluginCategoryNames.SUPPORT;
|
||||
String CODE_VIEWER = "Code Viewer";
|
||||
String BYTE_VIEWER = "Byte Viewer";
|
||||
String GRAPH = "Graph";
|
||||
String ANALYSIS = "Analysis";
|
||||
String NAVIGATION = "Navigation";
|
||||
String SEARCH = "Search";
|
||||
String TREE = "Program Tree";
|
||||
String TESTING = GenericPluginCategoryNames.TESTING;
|
||||
String DIAGNOSTIC = "Diagnostic";
|
||||
String DIFF = "Code Difference";
|
||||
String MISC = GenericPluginCategoryNames.MISC;
|
||||
String USER_ANNOTATION = "User Annotation";
|
||||
String EXAMPLES = GenericPluginCategoryNames.EXAMPLES;
|
||||
String SELECTION = "Selection";
|
||||
String INTERPRETERS = "Interpreters";
|
||||
String DEBUGGER = "Debugger";
|
||||
String PATCHING = "Patching";
|
||||
String DECOMPILER = "Decompiler";
|
||||
String UNMANAGED = "Unmanaged";
|
||||
|
||||
public String ANALYSIS = "Analysis";
|
||||
|
||||
// common to tools that open programs
|
||||
public String COMMON = "Common";
|
||||
public String CODE_VIEWER = "Code Viewer";
|
||||
public String DEBUGGER = "Debugger";
|
||||
public String DIAGNOSTIC = "Diagnostic";
|
||||
public String EXAMPLES = "Examples";
|
||||
public String FRAMEWORK = "Framework";
|
||||
public String GRAPH = "Graph";
|
||||
public String NAVIGATION = "Navigation";
|
||||
public String SEARCH = "Search";
|
||||
public String SELECTION = "Selection";
|
||||
public String PROGRAM_ORGANIZATION = "Program Organization";
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import ghidra.util.HelpLocation;
|
|||
@PluginInfo(
|
||||
status = PluginStatus.RELEASED,
|
||||
packageName = UtilityPluginPackage.NAME,
|
||||
category = PluginCategoryNames.SUPPORT,
|
||||
category = PluginCategoryNames.FRAMEWORK,
|
||||
shortDescription = "Manages themes for the Ghidra GUI",
|
||||
description = "Adds actions and options to manage Themes within Ghidra. " +
|
||||
"This plugin is available only in the Ghidra Project Window."
|
||||
|
|
|
@ -688,8 +688,8 @@ public class FrontEndPlugin extends Plugin
|
|||
connectionButton.setContentAreaFilled(false);
|
||||
connectionButton.setSelected(isConnected);
|
||||
connectionButton
|
||||
.setBorder(isConnected ? BorderFactory.createBevelBorder(BevelBorder.LOWERED)
|
||||
: BorderFactory.createBevelBorder(BevelBorder.RAISED));
|
||||
.setBorder(isConnected ? BorderFactory.createBevelBorder(BevelBorder.LOWERED)
|
||||
: BorderFactory.createBevelBorder(BevelBorder.RAISED));
|
||||
connectionIconPanel.add(connectionButton);
|
||||
if (isConnected) {
|
||||
|
||||
|
@ -701,7 +701,7 @@ public class FrontEndPlugin extends Plugin
|
|||
}
|
||||
}
|
||||
repositoryLabel
|
||||
.setText("Project Repository: " + repository.getName() + getAccessString(user));
|
||||
.setText("Project Repository: " + repository.getName() + getAccessString(user));
|
||||
|
||||
String serverName = repository.getServerInfo().getServerName();
|
||||
connectionButton.setToolTipText(
|
||||
|
@ -973,7 +973,7 @@ public class FrontEndPlugin extends Plugin
|
|||
};
|
||||
renameToolAction.setPopupMenuData(new MenuData(new String[] { "Rename..." }, "tool"));
|
||||
renameToolAction
|
||||
.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Rename Tool"));
|
||||
.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Rename Tool"));
|
||||
|
||||
propertiesAction = new ToolButtonAction(PROPERTIES_ACTION_NAME) {
|
||||
@Override
|
||||
|
@ -997,7 +997,7 @@ public class FrontEndPlugin extends Plugin
|
|||
new MenuData(new String[] { "Configure Plugins..." }, "zproperties"));
|
||||
|
||||
propertiesAction
|
||||
.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Configure_Tool"));
|
||||
.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Configure_Tool"));
|
||||
|
||||
tool.addLocalAction(frontEndProvider, exportToolAction);
|
||||
tool.addLocalAction(frontEndProvider, renameToolAction);
|
||||
|
|
|
@ -43,7 +43,7 @@ import docking.util.image.ToolIconURL;
|
|||
import docking.widgets.OptionDialog;
|
||||
import generic.jar.ResourceFile;
|
||||
import generic.util.WindowUtilities;
|
||||
import ghidra.app.plugin.GenericPluginCategoryNames;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.util.GenericHelpTopics;
|
||||
import ghidra.framework.Application;
|
||||
import ghidra.framework.LoggingInitialization;
|
||||
|
@ -279,7 +279,7 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
|||
|
||||
/**
|
||||
* Add those plugins that implement the ApplicationLevelPlugin interface and have a
|
||||
* RELEASED status and not (example || testing) category.
|
||||
* RELEASED status and not example category.
|
||||
*/
|
||||
private void installDefaultApplicationLevelPlugins() {
|
||||
List<String> classNames = new ArrayList<>();
|
||||
|
@ -288,8 +288,7 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
|||
|
||||
PluginDescription pd = PluginDescription.getPluginDescription(pluginClass);
|
||||
String category = pd.getCategory();
|
||||
boolean isBadCategory = category.equals(GenericPluginCategoryNames.EXAMPLES) ||
|
||||
category.equals(GenericPluginCategoryNames.TESTING);
|
||||
boolean isBadCategory = category.equals(PluginCategoryNames.EXAMPLES);
|
||||
if (pd.getStatus() == PluginStatus.RELEASED && !isBadCategory) {
|
||||
classNames.add(pluginClass.getName());
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class PluginDescription implements Comparable<PluginDescription> {
|
|||
|
||||
private static HashMap<Class<? extends Plugin>, PluginDescription> CACHE = new HashMap<>();
|
||||
private static final String DOTCLASS_EXT = ".class";
|
||||
private static final String NO_CATEGORY = "NO_CATEGORY";
|
||||
|
||||
private final Class<? extends Plugin> pluginClass;
|
||||
private final String name;
|
||||
|
@ -370,7 +371,7 @@ public class PluginDescription implements Comparable<PluginDescription> {
|
|||
*/
|
||||
private static PluginDescription createDefaultPluginDescription(Class<? extends Plugin> c) {
|
||||
return new PluginDescription(c, MiscellaneousPluginPackage.NAME,
|
||||
PluginCategoryNames.UNMANAGED, null, null, PluginStatus.UNSTABLE, false,
|
||||
NO_CATEGORY, null, null, PluginStatus.UNSTABLE, false,
|
||||
Collections.emptyList(), Collections.emptyList(), Collections.emptyList(),
|
||||
Collections.emptyList());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue