mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/GP-1-dragonmacher-front-end-fix'
This commit is contained in:
commit
26d3c933e7
2 changed files with 13 additions and 4 deletions
|
@ -206,13 +206,19 @@ class DockableToolBarManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabledForContext(ActionContext context) {
|
public boolean isEnabledForContext(ActionContext context) {
|
||||||
|
DockingWindowManager dwm = DockingWindowManager.getActiveInstance();
|
||||||
ComponentProvider provider = context.getComponentProvider();
|
ComponentProvider provider = context.getComponentProvider();
|
||||||
if (provider == null) {
|
if (provider == null) {
|
||||||
// Some context providers do not specify the provider when creating a contexts
|
// Some context providers do not specify the provider when creating a contexts
|
||||||
DockingWindowManager dwm = DockingWindowManager.getActiveInstance();
|
|
||||||
provider = dwm.getActiveComponentProvider();
|
provider = dwm.getActiveComponentProvider();
|
||||||
}
|
}
|
||||||
return provider == dockableComponent.getComponentProvider();
|
|
||||||
|
if (provider != dockableComponent.getComponentProvider()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't allow the last component in a window to be closed to prevent an empty window
|
||||||
|
return !dwm.isLastComponentInWindow(provider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,9 @@ public class ShowActionChooserDialogAction extends DockingAction {
|
||||||
|
|
||||||
private void showActionsDialog(Tool tool, DockingFrame frame, ActionContext context) {
|
private void showActionsDialog(Tool tool, DockingFrame frame, ActionContext context) {
|
||||||
ComponentProvider provider = tool.getWindowManager().getActiveComponentProvider();
|
ComponentProvider provider = tool.getWindowManager().getActiveComponentProvider();
|
||||||
|
if (provider == null) {
|
||||||
|
return; // this can happen if there is no active provider
|
||||||
|
}
|
||||||
ActionChooserDialog actionsDialog = new ActionChooserDialog(tool, provider, context);
|
ActionChooserDialog actionsDialog = new ActionChooserDialog(tool, provider, context);
|
||||||
tool.showDialog(actionsDialog);
|
tool.showDialog(actionsDialog);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue