From 9db570ac624077b76f95bf5a04dbda2031d12921 Mon Sep 17 00:00:00 2001
From: isabella3412 <40362506+isabella3412@users.noreply.github.com>
Date: Mon, 29 Jun 2026 15:06:21 +0000
Subject: [PATCH 1/3] Added Help file and menu shortcut for Accessibility
---
Ghidra/Features/Base/certification.manifest | 1 +
.../Base/src/main/help/help/TOC_Source.xml | 3 +-
.../Accessibility/AccessibilityOverview.html | 28 ++++++
.../framework/plugintool/PluginTool.java | 91 ++++++++++++++++---
4 files changed, 110 insertions(+), 13 deletions(-)
create mode 100644 Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
diff --git a/Ghidra/Features/Base/certification.manifest b/Ghidra/Features/Base/certification.manifest
index d9a184e025..ae258828b9 100644
--- a/Ghidra/Features/Base/certification.manifest
+++ b/Ghidra/Features/Base/certification.manifest
@@ -250,6 +250,7 @@ src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/About/About_Ghidra.htm||GHIDRA||||END|
src/main/help/help/topics/About/About_Program_File.htm||GHIDRA||||END|
src/main/help/help/topics/About/images/About_Program.png||GHIDRA||||END|
+src/main/help/help/topics/Accessibility/AccessibilityOverview.html||GHIDRA||||END|
src/main/help/help/topics/Annotations/Annotations.html||GHIDRA||||END|
src/main/help/help/topics/Annotations/images/CommentDialogURLExample.png||GHIDRA||||END|
src/main/help/help/topics/Annotations/images/InvalidAnnotationsDialogExample.png||GHIDRA||||END|
diff --git a/Ghidra/Features/Base/src/main/help/help/TOC_Source.xml b/Ghidra/Features/Base/src/main/help/help/TOC_Source.xml
index 47b845e71c..a9f086ddac 100644
--- a/Ghidra/Features/Base/src/main/help/help/TOC_Source.xml
+++ b/Ghidra/Features/Base/src/main/help/help/TOC_Source.xml
@@ -52,7 +52,7 @@
Paragraph Ghidra strives to be as accessible as possible to all users, including those relying on keyboard-only operation and screen readers. This document summarizes built-in accessibility features, recommended usage patterns, and known limitations. Paragraph Most of Ghidra's UI is built in Java/Swing, so screen reader behavior may differ from a web browser. To get the best results: Ghidra provides comprehensive keyboard navigation support to traverse UI components, windows, and providers. For full details, including focus traversal and navigation shortcuts, see the Keyboard Navigation topic. Ghidra's Quick Action dialog provides a fast, keyboard-first way to find and run any action. Press Ctrl + 3 to open it, then: This dialog is invaluable for screen-reader users or anyone who prefers keyboard navigation over menus. A quick launcher exists for Ghidra scripts. For details, see the Script Manager topic: Script Manager. Ghidra strives to be as accessible as possible to all users, including those relying on keyboard-only operation and screen readers. This document summarizes built-in accessibility features, recommended usage patterns, and known limitations. Ghidra strives to be as accessible as possible to all users, including those relying on
+ keyboard-only operation and screen readers. This document summarizes built-in accessibility
+ features, recommended usage patterns, and known limitations. Most of Ghidra's UI is built in Java/Swing, so screen reader behavior may differ from a web browser. To get the best results: Most of Ghidra's UI is built in Java/Swing, so screen reader behavior may differ from a web
+ browser. To get the best results: Ghidra provides comprehensive keyboard navigation support to traverse UI components, windows, and providers. For full details, including focus traversal and navigation shortcuts, see the Keyboard Navigation topic. Ghidra's Quick Action dialog provides a fast, keyboard-first way to find and run any action. Press Ctrl + 3 to open it, then: Ghidra provides comprehensive keyboard navigation support to traverse UI components,
+ windows, and providers. For full details, including focus traversal and navigation shortcuts,
+ see the Keyboard
+ Navigation topic. Ghidra's
+
+ Quick Action Dialog provides a fast, keyboard-first way to find and run any action.
+ Press Ctrl-3 to open it, then: This dialog is invaluable for screen-reader users or anyone who prefers keyboard navigation over menus. A quick launcher exists for Ghidra scripts. For details, see the Script Manager topic: Script Manager. The dialog remembers recently used actions across sessions for quick recall. This feature is
+ invaluable for screen-reader users or anyone who prefers keyboard navigation over menus. Ghidra's
+
+ Script Quick Launcher provides a quick way to run desired scripts.
+ Press Ctrl-Shift-S to open it, then:
+ The dialog remembers recentlyl used scripts for quick recall.Ghidra Accessibility
+
+ Header 2
+ Header 3
+
+
+
+
+
+
diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java
index cd052658a6..b45339939d 100644
--- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java
+++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java
@@ -15,24 +15,53 @@
*/
package ghidra.framework.plugintool;
-import static ghidra.framework.model.ToolTemplate.*;
+import static ghidra.framework.model.ToolTemplate.TOOL_INSTANCE_NAME_XML_NAME;
+import static ghidra.framework.model.ToolTemplate.TOOL_NAME_XML_NAME;
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FocusTraversalPolicy;
+import java.awt.Image;
+import java.awt.KeyboardFocusManager;
+import java.awt.Point;
+import java.awt.Window;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.net.URL;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
-import javax.swing.*;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.KeyStroke;
import org.jdom2.Element;
-import docking.*;
-import docking.action.*;
+import docking.AbstractDockingTool;
+import docking.ActionContext;
+import docking.ActionToGuiHelper;
+import docking.ComponentProvider;
+import docking.DialogComponentProvider;
+import docking.DockingUtils;
+import docking.DockingWindowManager;
+import docking.ErrLogDialog;
+import docking.ErrorReporter;
+import docking.action.ActionContextProvider;
+import docking.action.DockingAction;
+import docking.action.DockingActionIf;
+import docking.action.KeyBindingData;
+import docking.action.MenuData;
import docking.action.builder.ActionBuilder;
import docking.actions.PopupActionProvider;
import docking.actions.ToolActions;
@@ -43,24 +72,48 @@ import docking.tool.ToolConstants;
import docking.tool.util.DockingToolConstants;
import docking.util.image.ToolIconURL;
import docking.widgets.OptionDialog;
+import ghidra.framework.Application;
import ghidra.framework.OperatingSystem;
import ghidra.framework.Platform;
import ghidra.framework.cmd.BackgroundCommand;
import ghidra.framework.cmd.Command;
import ghidra.framework.main.AppInfo;
import ghidra.framework.main.UserAgreementDialog;
-import ghidra.framework.model.*;
-import ghidra.framework.options.*;
+import ghidra.framework.model.DomainFile;
+import ghidra.framework.model.DomainObject;
+import ghidra.framework.model.Project;
+import ghidra.framework.model.ProjectManager;
+import ghidra.framework.model.ToolListener;
+import ghidra.framework.model.ToolServices;
+import ghidra.framework.model.ToolTemplate;
+import ghidra.framework.options.Options;
+import ghidra.framework.options.OptionsChangeListener;
+import ghidra.framework.options.ToolOptions;
import ghidra.framework.plugintool.dialog.ManagePluginsDialog;
-import ghidra.framework.plugintool.mgr.*;
-import ghidra.framework.plugintool.util.*;
+import ghidra.framework.plugintool.mgr.DialogManager;
+import ghidra.framework.plugintool.mgr.EventManager;
+import ghidra.framework.plugintool.mgr.OptionsManager;
+import ghidra.framework.plugintool.mgr.ServiceManager;
+import ghidra.framework.plugintool.mgr.ToolTaskManager;
+import ghidra.framework.plugintool.util.DefaultPluginsConfiguration;
+import ghidra.framework.plugintool.util.PluginEventListener;
+import ghidra.framework.plugintool.util.PluginException;
+import ghidra.framework.plugintool.util.ServiceListener;
+import ghidra.framework.plugintool.util.TransientToolState;
+import ghidra.framework.plugintool.util.UndoRedoToolState;
import ghidra.framework.project.ProjectDataService;
import ghidra.framework.project.extensions.ExtensionTableDialog;
-import ghidra.util.*;
+import ghidra.util.HelpLocation;
+import ghidra.util.Msg;
+import ghidra.util.Swing;
import ghidra.util.exception.CancelledException;
-import ghidra.util.task.*;
+import ghidra.util.task.Task;
+import ghidra.util.task.TaskLauncher;
+import ghidra.util.task.TaskListener;
+import ghidra.util.task.TaskMonitor;
import help.Help;
import help.HelpService;
+import resources.ResourceManager;
/**
* Base class that is a container to manage plugins and their actions, and to coordinate the
@@ -1152,6 +1205,8 @@ public abstract class PluginTool extends AbstractDockingTool {
}
HelpService help = Help.getHelpService();
+
+
new ActionBuilder("Contents", ToolConstants.TOOL_OWNER)
.menuPath(ToolConstants.MENU_HELP, "&Contents")
@@ -1160,6 +1215,18 @@ public abstract class PluginTool extends AbstractDockingTool {
.inWindow(ActionBuilder.When.ALWAYS)
.onAction(c -> help.showHelp(null, false, getToolFrame()))
.buildAndInstall(this);
+
+ new ActionBuilder("Accessibility", ToolConstants.TOOL_OWNER)
+ .menuPath(ToolConstants.MENU_HELP, "&Accessibility")
+ .menuGroup("ZZZ")
+ .helpLocation(new HelpLocation("Accessibility", "AccessibilityOverview"))
+ .inWindow(ActionBuilder.When.ALWAYS)
+ .onAction(c -> {
+ help.showHelp(new HelpLocation("Accessibility", "AccessibilityOverview"));
+ })
+ .buildAndInstall(this);
+
+
}
/**
From 1c779da13a36a8aabb9b5e6f76d0419651f07b74 Mon Sep 17 00:00:00 2001
From: isabella3412 <40362506+isabella3412@users.noreply.github.com>
Date: Thu, 20 Aug 2026 20:12:58 +0000
Subject: [PATCH 2/3] Updated accessibility help page
---
.../Accessibility/AccessibilityOverview.html | 59 ++++++++++++++++---
1 file changed, 51 insertions(+), 8 deletions(-)
diff --git a/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html b/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
index d8cf3e4500..e2a26a0fbb 100644
--- a/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
+++ b/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
@@ -11,17 +11,60 @@
-
+
Ghidra Accessibility
+ Header 2
- Header 3
- Screen-Reader Guidance
+
-
+
+
+ Keyboard Navigation
+ Quick Action Dialog (Ctrl + 3)
+
+
+ Script Launcher (Ctrl + Shift + S)
+
+
+
+ Other Accessibility-Focused Enhancements
+
+
+
+ Known Limitations
+
+
+
+ Related Topics
+
From 88f02f225e72fbd91ed6eed2a64a19642cc2eca2 Mon Sep 17 00:00:00 2001
From: dragonmacher <48328597+dragonmacher@users.noreply.github.com>
Date: Thu, 17 Sep 2026 19:20:07 -0400
Subject: [PATCH 3/3] GP-6899 - Accessibility help updates
---
.../Accessibility/AccessibilityOverview.html | 104 +++++++++----
.../GhidraScriptMgrPlugin.htm | 2 +-
.../plugin/core/totd/TipOfTheDayPlugin.java | 30 +---
.../plugin/runtimeinfo/RuntimeInfoPlugin.java | 9 +-
.../KeyboardNavigation.html | 51 ++++---
.../main/java/docking/tool/ToolConstants.java | 7 +-
.../ghidra/framework/main/FrontEndTool.java | 5 +-
.../framework/plugintool/PluginTool.java | 143 ++++++------------
8 files changed, 169 insertions(+), 182 deletions(-)
diff --git a/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html b/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
index e2a26a0fbb..e8039d56cf 100644
--- a/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
+++ b/Ghidra/Features/Base/src/main/help/help/topics/Accessibility/AccessibilityOverview.html
@@ -11,61 +11,105 @@
-
+
Ghidra Accessibility
-
+
+
+
Screen-Reader Guidance
-
+
+ Keyboard Navigation
- Quick Action Dialog (Ctrl + 3)
-
+
+
+
+ Quick Action Dialog (Ctrl-3)
+
+
+
+
+
- Script Launcher (Ctrl + Shift + S)
-
-
+ Script Launcher (Ctrl-Shift-S)
+
+
+
+
+
Other Accessibility-Focused Enhancements
-
+
+ Known Limitations
+
+
-
-
+ Related Topics
+
-
diff --git a/Ghidra/Features/Base/src/main/help/help/topics/GhidraScriptMgrPlugin/GhidraScriptMgrPlugin.htm b/Ghidra/Features/Base/src/main/help/help/topics/GhidraScriptMgrPlugin/GhidraScriptMgrPlugin.htm
index 5357aec068..1035d39799 100644
--- a/Ghidra/Features/Base/src/main/help/help/topics/GhidraScriptMgrPlugin/GhidraScriptMgrPlugin.htm
+++ b/Ghidra/Features/Base/src/main/help/help/topics/GhidraScriptMgrPlugin/GhidraScriptMgrPlugin.htm
@@ -132,7 +132,7 @@
Manager.
This key binding action shows a dialog to quickly find and run scripts. diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayPlugin.java index 06640b9cbc..baface0889 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/totd/TipOfTheDayPlugin.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. @@ -20,17 +20,13 @@ import java.io.InputStream; import java.util.*; import java.util.stream.Collectors; -import docking.ActionContext; -import docking.action.DockingAction; -import docking.action.MenuData; -import docking.tool.ToolConstants; import ghidra.app.CorePluginPackage; import ghidra.app.plugin.PluginCategoryNames; import ghidra.framework.main.ApplicationLevelOnlyPlugin; import ghidra.framework.plugintool.*; import ghidra.framework.plugintool.util.PluginStatus; import ghidra.framework.preferences.Preferences; -import ghidra.util.HelpLocation; +import ghidra.util.Swing; import ghidra.util.SystemUtilities; import utilities.util.FileUtilities; @@ -48,7 +44,6 @@ public class TipOfTheDayPlugin extends Plugin implements ApplicationLevelOnlyPlu private static final String SHOW_TIPS = "SHOW_TIPS"; private TipOfTheDayDialog dialog; - private DockingAction action; public TipOfTheDayPlugin(PluginTool tool) { super(tool); @@ -56,19 +51,6 @@ public class TipOfTheDayPlugin extends Plugin implements ApplicationLevelOnlyPlu @Override protected void init() { - action = new DockingAction("Tips of the day", getName()) { - @Override - public void actionPerformed(ActionContext context) { - dialog.doShow(tool.getToolFrame()); - } - }; - action.setMenuBarData(new MenuData(new String[] { "Help", "Tip of the Day" }, - ToolConstants.HELP_CONTENTS_MENU_GROUP)); - - action.setEnabled(true); - action.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Tip_of_the_day")); - tool.addAction(action); - List
tips = null; try { tips = loadTips(); @@ -91,8 +73,6 @@ public class TipOfTheDayPlugin extends Plugin implements ApplicationLevelOnlyPlu @Override protected void dispose() { writePreferences(); - - action.dispose(); dialog.close(); } @@ -101,7 +81,7 @@ public class TipOfTheDayPlugin extends Plugin implements ApplicationLevelOnlyPlu String showTipsStr = Preferences.getProperty(SHOW_TIPS, "true", true); int tipIndex = Integer.parseInt(tipIndexStr); - final boolean showTips = Boolean.parseBoolean(showTipsStr); + boolean showTips = Boolean.parseBoolean(showTipsStr); if (showTips) { tipIndex = (++tipIndex) % dialog.getNumberOfTips(); writePreferences(tipIndex, showTips); @@ -110,7 +90,7 @@ public class TipOfTheDayPlugin extends Plugin implements ApplicationLevelOnlyPlu dialog.setTipIndex(tipIndex); dialog.setShowTips(showTips); - SystemUtilities.runSwingLater(() -> { + Swing.runLater(() -> { if (showTips && !SystemUtilities.isInTestingMode()) { dialog.show(tool.getToolFrame()); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/runtimeinfo/RuntimeInfoPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/runtimeinfo/RuntimeInfoPlugin.java index 64e218ef9c..1962470c66 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/runtimeinfo/RuntimeInfoPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/runtimeinfo/RuntimeInfoPlugin.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. @@ -16,6 +16,7 @@ package ghidra.app.plugin.runtimeinfo; import docking.action.builder.ActionBuilder; +import docking.tool.ToolConstants; import ghidra.app.plugin.PluginCategoryNames; import ghidra.framework.main.ApplicationLevelOnlyPlugin; import ghidra.framework.main.UtilityPluginPackage; @@ -50,7 +51,7 @@ public class RuntimeInfoPlugin extends Plugin implements ApplicationLevelOnlyPlu .onAction(context -> showInstalledProcessors()) .enabled(true) .menuPath("Help", supportedActionName) - .menuGroup("YYY") // trying to put this just above the last menu entry + .menuGroup(ToolConstants.HELP_RUNTIME_MENU_GROUP) .helpLocation(getInstalledProcessorsHelpLocation()) .buildAndInstall(tool); @@ -59,7 +60,7 @@ public class RuntimeInfoPlugin extends Plugin implements ApplicationLevelOnlyPlu .onAction(context -> showRuntimeInfo()) .enabled(true) .menuPath("Help", runtimeInfoActionName) - .menuGroup("YYY") + .menuGroup(ToolConstants.HELP_RUNTIME_MENU_GROUP) .helpLocation(getRuntimeInfoHelpLocation()) .buildAndInstall(tool); } diff --git a/Ghidra/Framework/Docking/src/main/help/help/topics/KeyboardNavigation/KeyboardNavigation.html b/Ghidra/Framework/Docking/src/main/help/help/topics/KeyboardNavigation/KeyboardNavigation.html index 5c493b177b..25e0b4fa85 100644 --- a/Ghidra/Framework/Docking/src/main/help/help/topics/KeyboardNavigation/KeyboardNavigation.html +++ b/Ghidra/Framework/Docking/src/main/help/help/topics/KeyboardNavigation/KeyboardNavigation.html @@ -20,44 +20,57 @@ Ghidra supports standard keyboard navigation for traversing component focus - cycles within each window. In general, TAB and <CTRL> TAB will transfer focus to - the next component. And <SHIFT> TAB and <CTRL><SHIFT>TAB will transfer - focus to the previous component in the cycle. TAB and <SHIFT>TAB do not always work - as they are sometimes used by individual components such as text components, but the - <CTRL> versions should work universally.
+ cycles within each window. In general, Tab and Ctrl-Tab will transfer focus to + the next component. Shift-Tab and Ctrl-Shift-Tab will transfer + focus to the previous component. + + +++
+ Tab and Shift-Tab do not always work + as they are sometimes used by individual components, such as text components. The + Ctrl versions should work universally.
Ghidra also provides some handy shortcut keys for navigation:
-
- <CTRL>F3 - Transfer focus to the next window or dialog.
+- Ctrl-F3 - Transfer focus (jump) to the next window or dialog.
-- <CTRL><SHIFT>F3 - Transfer focus to the previous window or dialog.
+- Ctrl-Shift-F3 - Transfer focus (jump) to the previous window or + dialog.
-- <CTRL>J - Transfer focus (Jump) to the next component provider (titled +
- Ctrl-J - Transfer focus (jump) to the next component provider (titled component).
-- <CTRL><SHIFT>J - Transfer focus (Jump) to the previous component +
- Ctrl-Shift-J - Transfer focus (jump) to the previous component provider.
+ +- + Ctrl-F6 - Transfer focus (jump) to the last active component + provider. This allows the user to jump back and forth between recently used provider. +
+Actions
--Global menus can be reached using the various accelerator keys such as <ALT>F to +
Global menus can be reached using the various accelerator keys such as Alt-F to access the File menu.
-Context menus can be invoked using the <SHIFT>F10 key or the dedicated context +
Context menus can be invoked using the Shift-F10 key or the dedicated context menu key available on some keyboards.
Toolbar actions currently can't be directly accessed via the keyboard unless a keybinding is assigned to them.
Actions Dialog
+Quick Action Dialog
-The Actions Dialog displays a list of all actions (or commands) relevant to the +
The Quick Action Dialog displays a list of all actions (or commands) relevant to the currently focused component window or dialog and allows the user to select and invoke any valid, enabled action using either the mouse or keyboard.
@@ -70,24 +83,24 @@Initially, the dialog shows just the local toolbar and menu items for the currently focused component, along with all relevant popup and keyboard actions. Repeatedly - pressing the keybinding assigned to this action (default is <CTRL> 3) will show + pressing the keybinding assigned to this action (default is Ctrl-3) will show additional, less relevant actions.
Displayed actions in the list can be selected via the mouse or by using the up/down arrows to move the current selection. Pressing the OK button or pressing the - <ENTER> key will cause the dialog to close and the action to be invoked.
+ Enter key will cause the dialog to close and the action to be invoked.Also, the list can be filtered by typing in the provided text box.
+ its assigned keybinding (default is Ctrl-3). -
This dialog can be invoked using - its assigned keybinding (default is <CTRL> 3).
+
Help (F1) and Assign Keybinding - (F4) actions work on the selected action.
Help (F1) and Assign Keybinding + (F4) actions work on the selected action.
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/tool/ToolConstants.java b/Ghidra/Framework/Docking/src/main/java/docking/tool/ToolConstants.java index 7099934e0b..87604c1a66 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/tool/ToolConstants.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/tool/ToolConstants.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. @@ -81,6 +81,9 @@ public interface ToolConstants extends DockingToolConstants { /** A group for actions that link directly to help content */ public static final String HELP_CONTENTS_MENU_GROUP = "AAAHelpContents"; + /** A group for actions that show system runtime information */ + public static final String HELP_RUNTIME_MENU_GROUP = "RRRHelpContents"; + /** * Constant for the options menu group for the Tool Options menu item */ diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndTool.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndTool.java index 7a96a1a783..8ccbec104c 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndTool.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndTool.java @@ -788,14 +788,15 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener { addHelpActions(); // our log file action - DockingAction action = new DockingAction("Show Log", ToolConstants.TOOL_OWNER) { + DockingAction action = new DockingAction("View Log", ToolConstants.TOOL_OWNER) { @Override public void actionPerformed(ActionContext context) { showGhidraUserLogFile(); } }; action.setMenuBarData( - new MenuData(new String[] { ToolConstants.MENU_HELP, "Show Log" }, null, "BBB")); + new MenuData(new String[] { ToolConstants.MENU_HELP, "Show Log" }, null, + ToolConstants.HELP_RUNTIME_MENU_GROUP)); action.setEnabled(true); addAction(action); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java index b45339939d..20ddd77431 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java @@ -15,53 +15,24 @@ */ package ghidra.framework.plugintool; -import static ghidra.framework.model.ToolTemplate.TOOL_INSTANCE_NAME_XML_NAME; -import static ghidra.framework.model.ToolTemplate.TOOL_NAME_XML_NAME; +import static ghidra.framework.model.ToolTemplate.*; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FocusTraversalPolicy; -import java.awt.Image; -import java.awt.KeyboardFocusManager; -import java.awt.Point; -import java.awt.Window; +import java.awt.*; import java.awt.event.KeyEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.net.URL; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; +import java.util.*; import java.util.List; -import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JEditorPane; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.KeyStroke; +import javax.swing.*; import org.jdom2.Element; -import docking.AbstractDockingTool; -import docking.ActionContext; -import docking.ActionToGuiHelper; -import docking.ComponentProvider; -import docking.DialogComponentProvider; -import docking.DockingUtils; -import docking.DockingWindowManager; -import docking.ErrLogDialog; -import docking.ErrorReporter; -import docking.action.ActionContextProvider; -import docking.action.DockingAction; -import docking.action.DockingActionIf; -import docking.action.KeyBindingData; -import docking.action.MenuData; +import docking.*; +import docking.action.*; import docking.action.builder.ActionBuilder; import docking.actions.PopupActionProvider; import docking.actions.ToolActions; @@ -72,48 +43,24 @@ import docking.tool.ToolConstants; import docking.tool.util.DockingToolConstants; import docking.util.image.ToolIconURL; import docking.widgets.OptionDialog; -import ghidra.framework.Application; import ghidra.framework.OperatingSystem; import ghidra.framework.Platform; import ghidra.framework.cmd.BackgroundCommand; import ghidra.framework.cmd.Command; import ghidra.framework.main.AppInfo; import ghidra.framework.main.UserAgreementDialog; -import ghidra.framework.model.DomainFile; -import ghidra.framework.model.DomainObject; -import ghidra.framework.model.Project; -import ghidra.framework.model.ProjectManager; -import ghidra.framework.model.ToolListener; -import ghidra.framework.model.ToolServices; -import ghidra.framework.model.ToolTemplate; -import ghidra.framework.options.Options; -import ghidra.framework.options.OptionsChangeListener; -import ghidra.framework.options.ToolOptions; +import ghidra.framework.model.*; +import ghidra.framework.options.*; import ghidra.framework.plugintool.dialog.ManagePluginsDialog; -import ghidra.framework.plugintool.mgr.DialogManager; -import ghidra.framework.plugintool.mgr.EventManager; -import ghidra.framework.plugintool.mgr.OptionsManager; -import ghidra.framework.plugintool.mgr.ServiceManager; -import ghidra.framework.plugintool.mgr.ToolTaskManager; -import ghidra.framework.plugintool.util.DefaultPluginsConfiguration; -import ghidra.framework.plugintool.util.PluginEventListener; -import ghidra.framework.plugintool.util.PluginException; -import ghidra.framework.plugintool.util.ServiceListener; -import ghidra.framework.plugintool.util.TransientToolState; -import ghidra.framework.plugintool.util.UndoRedoToolState; +import ghidra.framework.plugintool.mgr.*; +import ghidra.framework.plugintool.util.*; import ghidra.framework.project.ProjectDataService; import ghidra.framework.project.extensions.ExtensionTableDialog; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.Swing; +import ghidra.util.*; import ghidra.util.exception.CancelledException; -import ghidra.util.task.Task; -import ghidra.util.task.TaskLauncher; -import ghidra.util.task.TaskListener; -import ghidra.util.task.TaskMonitor; +import ghidra.util.task.*; import help.Help; import help.HelpService; -import resources.ResourceManager; /** * Base class that is a container to manage plugins and their actions, and to coordinate the @@ -1176,6 +1123,37 @@ public abstract class PluginTool extends AbstractDockingTool { } protected void addHelpActions() { + + HelpService help = Help.getHelpService(); + + int subgroup = 0; + new ActionBuilder("Contents", ToolConstants.TOOL_OWNER) + .menuPath(ToolConstants.MENU_HELP, "&Contents") + .menuGroup(ToolConstants.HELP_CONTENTS_MENU_GROUP, Integer.toString(subgroup++)) + .helpLocation(new HelpLocation("Misc", "Welcome_to_Ghidra_Help")) + .inWindow(ActionBuilder.When.ALWAYS) + .onAction(c -> help.showHelp(null, false, getToolFrame())) + .buildAndInstall(this); + + new ActionBuilder("Accessibility", ToolConstants.TOOL_OWNER) + .menuPath(ToolConstants.MENU_HELP, "&Accessibility") + .menuGroup(ToolConstants.HELP_CONTENTS_MENU_GROUP, Integer.toString(subgroup++)) + .helpLocation(new HelpLocation("Accessibility", "AccessibilityOverview")) + .inWindow(ActionBuilder.When.ALWAYS) + .onAction(c -> { + help.showHelp(new HelpLocation("Accessibility", "AccessibilityOverview")); + }) + .buildAndInstall(this); + + new ActionBuilder("User Agreement", ToolConstants.TOOL_OWNER) + .menuPath(ToolConstants.MENU_HELP, "&User Agreement") + .menuGroup(ToolConstants.HELP_CONTENTS_MENU_GROUP, Integer.toString(subgroup++)) + .helpLocation(new HelpLocation(ToolConstants.ABOUT_HELP_TOPIC, "User_Agreement")) + .inWindow(ActionBuilder.When.ALWAYS) + .onAction( + c -> DockingWindowManager.showDialog(new UserAgreementDialog(false, false))) + .buildAndInstall(this); + new ActionBuilder("About Ghidra", ToolConstants.TOOL_OWNER) .menuPath(ToolConstants.MENU_HELP, "&About Ghidra") .menuGroup("ZZA") @@ -1184,16 +1162,7 @@ public abstract class PluginTool extends AbstractDockingTool { .onAction(c -> DockingWindowManager.showDialog(new AboutDialog())) .buildAndInstall(this); - new ActionBuilder("User Agreement", ToolConstants.TOOL_OWNER) - .menuPath(ToolConstants.MENU_HELP, "&User Agreement") - .menuGroup(ToolConstants.HELP_CONTENTS_MENU_GROUP) - .helpLocation(new HelpLocation(ToolConstants.ABOUT_HELP_TOPIC, "User_Agreement")) - .inWindow(ActionBuilder.When.ALWAYS) - .onAction( - c -> DockingWindowManager.showDialog(new UserAgreementDialog(false, false))) - .buildAndInstall(this); - - final ErrorReporter reporter = ErrLogDialog.getErrorReporter(); + ErrorReporter reporter = ErrLogDialog.getErrorReporter(); if (reporter != null) { new ActionBuilder("Report Bug", ToolConstants.TOOL_OWNER) .menuPath(ToolConstants.MENU_HELP, "&Report Bug...") @@ -1203,30 +1172,6 @@ public abstract class PluginTool extends AbstractDockingTool { .onAction(c -> reporter.report(getToolFrame(), "User Bug Report", null)) .buildAndInstall(this); } - - HelpService help = Help.getHelpService(); - - - - new ActionBuilder("Contents", ToolConstants.TOOL_OWNER) - .menuPath(ToolConstants.MENU_HELP, "&Contents") - .menuGroup(ToolConstants.HELP_CONTENTS_MENU_GROUP) - .helpLocation(new HelpLocation("Misc", "Welcome_to_Ghidra_Help")) - .inWindow(ActionBuilder.When.ALWAYS) - .onAction(c -> help.showHelp(null, false, getToolFrame())) - .buildAndInstall(this); - - new ActionBuilder("Accessibility", ToolConstants.TOOL_OWNER) - .menuPath(ToolConstants.MENU_HELP, "&Accessibility") - .menuGroup("ZZZ") - .helpLocation(new HelpLocation("Accessibility", "AccessibilityOverview")) - .inWindow(ActionBuilder.When.ALWAYS) - .onAction(c -> { - help.showHelp(new HelpLocation("Accessibility", "AccessibilityOverview")); - }) - .buildAndInstall(this); - - } /**
Bringing up this dialog and pressing - (<CTRL> 3) a few times to show all local and global actions is a great way to + (Ctrl-3) a few times to show all local and global actions is a great way to explore all the actions Ghidra actions.