From 1442ed87b9bca36da346649226d29b58143e943c Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Mon, 18 May 2026 17:52:29 -0400 Subject: [PATCH] Minor help tweaks --- .../java/docking/action/AbstractHelpAction.java | 13 ++++++++++--- .../src/main/java/docking/help/HelpManager.java | 7 +++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/action/AbstractHelpAction.java b/Ghidra/Framework/Docking/src/main/java/docking/action/AbstractHelpAction.java index 9d617a83d2..6a6fa79a6e 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/action/AbstractHelpAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/action/AbstractHelpAction.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,6 +22,7 @@ import javax.swing.KeyStroke; import docking.*; import ghidra.util.HelpLocation; import ghidra.util.SystemUtilities; +import help.HelpDescriptor; import help.HelpService; /** @@ -56,6 +57,7 @@ public abstract class AbstractHelpAction extends DockingAction { @Override public void actionPerformed(ActionContext context) { + DockingActionIf mouseOverAction = DockingWindowManager.getMouseOverAction(); if (mouseOverAction != null) { showHelp(mouseOverAction); @@ -126,7 +128,12 @@ public abstract class AbstractHelpAction extends DockingAction { return startingHelpObject; } - // Second, with no help registered for the starting component, start looking for a suitable + // Second, see if we are showing help info and this object knows how to do that + if (isInfo() && startingHelpObject instanceof HelpDescriptor) { + return startingHelpObject; + } + + // Finally, with no help registered for the starting component, start looking for a suitable // help proxy. // // For Components, we can walk their containment hierarchy to find a potential help object diff --git a/Ghidra/Framework/Docking/src/main/java/docking/help/HelpManager.java b/Ghidra/Framework/Docking/src/main/java/docking/help/HelpManager.java index 2241ae2b8b..d4ffc93dc3 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/help/HelpManager.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/help/HelpManager.java @@ -18,8 +18,7 @@ package docking.help; import java.awt.*; import java.io.IOException; import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; +import java.net.*; import java.util.*; import java.util.List; import java.util.Map; @@ -358,9 +357,9 @@ public class HelpManager implements HelpService { // To do this, try making a URL out of the help string and doing a reverse lookup URL URL = null; try { - URL = new URL(helpIDString); + URL = URI.create(helpIDString).toURL(); } - catch (MalformedURLException e) { + catch (IllegalArgumentException | MalformedURLException e) { // nothing we can do, fall through the method to the previous exception }