mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Merge remote-tracking branch 'origin/GP-5344-dragonmacher-front-end-tool-closing-fix'
This commit is contained in:
commit
69439da80a
2 changed files with 22 additions and 4 deletions
|
@ -1104,17 +1104,21 @@ public abstract class ComponentProvider implements HelpDescriptor, ActionContext
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionContext context) {
|
public void actionPerformed(ActionContext context) {
|
||||||
|
|
||||||
|
Tool tool = getTool();
|
||||||
|
DockingWindowManager myDwm = tool.getWindowManager();
|
||||||
boolean isFrustrated = isFrustrated();
|
boolean isFrustrated = isFrustrated();
|
||||||
boolean isFocused = isFocused();
|
boolean isFocused = isFocused();
|
||||||
if (isFocused && !isFrustrated) {
|
if (isFocused && !isFrustrated) {
|
||||||
// the user has decided to hide this component and is not madly clicking
|
// the user has decided to hide this component and is not madly clicking; also, we
|
||||||
|
// don't allow the last component in a window to be closed in order to prevent an
|
||||||
|
// empty window.
|
||||||
|
if (!myDwm.isLastComponentInWindow(ComponentProvider.this)) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean emphasize = getComponent().isShowing() && isFrustrated;
|
boolean emphasize = getComponent().isShowing() && isFrustrated;
|
||||||
Tool tool = getTool();
|
|
||||||
DockingWindowManager myDwm = tool.getWindowManager();
|
|
||||||
myDwm.showComponent(ComponentProvider.this, true, emphasize);
|
myDwm.showComponent(ComponentProvider.this, true, emphasize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -478,6 +478,20 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
|
||||||
return windowNode.getComponentCount() == 1;
|
return windowNode.getComponentCount() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the given provider is the last provider in its window.
|
||||||
|
* @param provider the provider
|
||||||
|
* @return true if the given provider is the last provider in its window.
|
||||||
|
*/
|
||||||
|
public boolean isLastComponentInWindow(ComponentProvider provider) {
|
||||||
|
Window providerWindow = getProviderWindow(provider);
|
||||||
|
WindowNode providerNode = root.getNodeForWindow(providerWindow);
|
||||||
|
if (providerNode != null) {
|
||||||
|
return providerNode.getComponentCount() == 1;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the visible state of the set of docking windows.
|
* Sets the visible state of the set of docking windows.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue