Ghidra is a software reverse engineering (SRE) framework
GP-5859: Both enablement and pop-up of Patch Data controlled by unit type
Danf79a1a281643
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AbstractPatchAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AbstractPatchAction.javaindex 9f8e17efb2..61811e5a87 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AbstractPatchAction.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AbstractPatchAction.java@@ -286,8 +286,7 @@ public abstract class AbstractPatchAction extends DockingAction {*/protected abstract boolean isApplicableToUnit(CodeUnit unit);- @Override- public boolean isAddToPopup(ActionContext context) {+ protected boolean isApplicableToContext(ActionContext context) {CodeUnit cu = getCodeUnit(context);if (cu == null || !isApplicableToUnit(cu)) {return false;@@ -320,6 +319,16 @@ public abstract class AbstractPatchAction extends DockingAction {return true;}+ @Override+ public boolean isEnabledForContext(ActionContext context) {+ return super.isEnabledForContext(context) && isApplicableToContext(context);+ }++ @Override+ public boolean isAddToPopup(ActionContext context) {+ return super.isAddToPopup(context) && isApplicableToContext(context);+ }+/*** Perform preparation and save any information needed later in {@link #accept()}.*/