Skip to content

Ghidra is a software reverse engineering (SRE) framework

Fixed the Install Extensions dialog toolbar action enablement

dragonmacher5b3f4e9e9050
diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionTableProvider.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionTableProvider.java
index 66c6ae2276..3164509eec 100644
--- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionTableProvider.java
+++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionTableProvider.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.
@@ -123,6 +123,15 @@ public class ExtensionTableProvider extends DialogComponentProvider {
Icon addIcon = Icons.ADD_ICON;
DockingAction addAction = new DockingAction("ExtensionTools", "AddExtension") {
+ @Override
+ public boolean isEnabledForContext(ActionContext context) {
+ if (Application.inSingleJarMode()) {
+ return false;
+ }
+ Object contextObject = context.getContextObject();
+ return ExtensionTableProvider.this == contextObject;
+ }
+
@Override
public void actionPerformed(ActionContext context) {
@@ -163,7 +172,6 @@ public class ExtensionTableProvider extends DialogComponentProvider {
addAction.setToolBarData(new ToolBarData(addIcon, group));
addAction.setHelpLocation(new HelpLocation(GenericHelpTopics.FRONT_END, "ExtensionTools"));
addAction.setDescription("Add extension");
- addAction.setEnabled(!Application.inSingleJarMode());
addAction(addAction);
}
@@ -199,6 +207,12 @@ public class ExtensionTableProvider extends DialogComponentProvider {
Icon refreshIcon = Icons.REFRESH_ICON;
DockingAction refreshAction = new DockingAction("ExtensionTools", "RefreshExtensions") {
+ @Override
+ public boolean isEnabledForContext(ActionContext context) {
+ Object contextObject = context.getContextObject();
+ return ExtensionTableProvider.this == contextObject;
+ }
+
@Override
public void actionPerformed(ActionContext context) {
tablePanel.refreshTable();