Merge remote-tracking branch 'origin/GP-3400-dragonmacher-enable-diagnostic-actions' into Ghidra_10.3

This commit is contained in:
ghidra1 2023-05-08 14:52:23 -04:00
commit fa640f179c

View file

@ -34,7 +34,7 @@ import docking.action.*;
import docking.tool.util.DockingToolConstants; import docking.tool.util.DockingToolConstants;
import generic.util.action.ReservedKeyBindings; import generic.util.action.ReservedKeyBindings;
import ghidra.framework.options.*; import ghidra.framework.options.*;
import ghidra.util.*; import ghidra.util.Msg;
import ghidra.util.exception.AssertException; import ghidra.util.exception.AssertException;
import util.CollectionUtils; import util.CollectionUtils;
@ -51,7 +51,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
/* /*
Map of Maps of Sets Map of Maps of Sets
Owner Name -> Owner Name ->
Action Name -> Set of Actions Action Name -> Set of Actions
*/ */
private Map<String, Map<String, Set<DockingActionIf>>> actionsByNameByOwner = LazyMap.lazyMap( private Map<String, Map<String, Set<DockingActionIf>>> actionsByNameByOwner = LazyMap.lazyMap(
@ -96,12 +96,10 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
keyBindingsManager.addReservedAction( keyBindingsManager.addReservedAction(
new ShowContextMenuAction(ReservedKeyBindings.CONTEXT_MENU_KEY2)); new ShowContextMenuAction(ReservedKeyBindings.CONTEXT_MENU_KEY2));
// these are diagnostic // helpful debugging actions
if (SystemUtilities.isInDevelopmentMode()) { keyBindingsManager.addReservedAction(new ShowFocusInfoAction());
keyBindingsManager.addReservedAction(new ShowFocusInfoAction()); keyBindingsManager.addReservedAction(new ShowFocusCycleAction());
keyBindingsManager.addReservedAction(new ShowFocusCycleAction()); keyBindingsManager.addReservedAction(new ComponentThemeInspectorAction());
keyBindingsManager.addReservedAction(new ComponentThemeInspectorAction());
}
} }
public void dispose() { public void dispose() {
@ -118,7 +116,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
} }
/** /**
* Add an action that works specifically with a component provider. * Add an action that works specifically with a component provider.
* @param provider provider associated with the action * @param provider provider associated with the action
* @param action local action to the provider * @param action local action to the provider
*/ */
@ -294,7 +292,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
} }
/** /**
* Get the keybindings for each action so that they are still registered as being used; * Get the keybindings for each action so that they are still registered as being used;
* otherwise the options will be removed because they are noted as not being used. * otherwise the options will be removed because they are noted as not being used.
*/ */
public synchronized void restoreKeyBindings() { public synchronized void restoreKeyBindings() {
@ -317,7 +315,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
} }
/** /**
* Remove an action that works specifically with a component provider. * Remove an action that works specifically with a component provider.
* @param provider provider associated with the action * @param provider provider associated with the action
* @param action local action to the provider * @param action local action to the provider
*/ */
@ -365,7 +363,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
private void updateKeyBindingsFromOptions(ToolOptions options, String optionName, private void updateKeyBindingsFromOptions(ToolOptions options, String optionName,
KeyStroke newKs) { KeyStroke newKs) {
// note: the 'shared actions' update themselves, so we only need to handle standard actions // note: the 'shared actions' update themselves, so we only need to handle standard actions
Matcher matcher = ACTION_NAME_PATTERN.matcher(optionName); Matcher matcher = ACTION_NAME_PATTERN.matcher(optionName);
matcher.find(); matcher.find();
@ -390,7 +388,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
DockingActionIf action = (DockingActionIf) evt.getSource(); DockingActionIf action = (DockingActionIf) evt.getSource();
if (!action.getKeyBindingType().isManaged()) { if (!action.getKeyBindingType().isManaged()) {
// this reads unusually, but we need to notify the tool to rebuild its 'Window' menu // this reads unusually, but we need to notify the tool to rebuild its 'Window' menu
// in the case that this action is one of the tool's special actions // in the case that this action is one of the tool's special actions
keyBindingsChanged(); keyBindingsChanged();
return; return;
@ -437,7 +435,7 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
} }
/** /**
* Allows clients to register an action by using a placeholder. This is useful when * Allows clients to register an action by using a placeholder. This is useful when
* an API wishes to have a central object (like a plugin) register actions for transient * an API wishes to have a central object (like a plugin) register actions for transient
* providers, that may not be loaded until needed. * providers, that may not be loaded until needed.
* *