From abca848c4a0a93dde88b58ccef10071b10223204 Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:14:27 -0500 Subject: [PATCH] Test fixes for missing options help --- .../core/sourcefilestable/SourceFilesTablePlugin.java | 7 +++---- .../app/util/viewer/field/SourceMapFieldFactory.java | 1 + .../plugin/core/codebrowser/CodeBrowserOptionsTest.java | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/sourcefilestable/SourceFilesTablePlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/sourcefilestable/SourceFilesTablePlugin.java index 9f651e5acd..ce3fe6bab1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/sourcefilestable/SourceFilesTablePlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/sourcefilestable/SourceFilesTablePlugin.java @@ -322,7 +322,6 @@ public class SourceFilesTablePlugin extends ProgramPlugin implements OptionsChan } - private void initOptions(ToolOptions options) { options.registerOption(USE_EXISTING_AS_DEFAULT_OPTION_NAME, true, new HelpLocation(getName(), "Use_Existing_As_Default"), @@ -336,8 +335,8 @@ public class SourceFilesTablePlugin extends ProgramPlugin implements OptionsChan () -> new StringWithChoicesEditor(VIEWERS)); selectedViewer = options.getString(SELECTED_VIEWER_OPTION_NAME, VS_CODE); options.addOptionsChangeListener(this); + + options.setOptionsHelpLocation( + new HelpLocation(getName(), "Source_Files_Table_Plugin_Options")); } - - - } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SourceMapFieldFactory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SourceMapFieldFactory.java index b7c45cd69b..1053e82c6c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SourceMapFieldFactory.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SourceMapFieldFactory.java @@ -243,6 +243,7 @@ public class SourceMapFieldFactory extends FieldFactory { "Show source file identifier info"); showIdentifier = fieldOptions.getBoolean(SHOW_IDENTIFIER_OPTION_NAME, false); + fieldOptions.getOptions(GROUP_TITLE).setOptionsHelpLocation(helpLoc); } private List getSourceMapEntries(CodeUnit cu) { diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserOptionsTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserOptionsTest.java index 98d5909bd0..89675664f3 100644 --- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserOptionsTest.java +++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/codebrowser/CodeBrowserOptionsTest.java @@ -1007,13 +1007,15 @@ public class CodeBrowserOptionsTest extends AbstractGhidraHeadedIntegrationTest List nestedHelp = getParentHelpLocations(options, name); for (HelpLocation help : nestedHelp) { if (help != null && !isValidHelpLocation(help)) { - missing.add("Bad help location: " + help.toString()); + missing.add("Bad parent help for path: " + options.getName() + "." + name + + "; help: " + help.toString() + "\nMake sure your options parent node " + + "has a help location set, in addition to the individual options " + + "node"); } } // it has a help location; is it valid? if (hl != null && !isValidHelpLocation(hl)) { - isValidHelpLocation(hl); missing.add(options.getName() + "." + name); } }