mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-25 17:00:36 -09:00
Fixed the Install Extensions dialog toolbar action enablement
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user