mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-08-27 21:10:26 +00:00
GT-2869 - Shared Key Bindings - review fixes
This commit is contained in:
parent
5a9067832a
commit
c1de98304a
|
@ -66,8 +66,7 @@ public abstract class AbstractFindReferencesDataTypeAction extends DockingAction
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,8 +43,7 @@ public class CycleGroupAction extends CompositeEditorTableAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,8 +54,7 @@ public class ChooseDataTypeAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,8 +58,7 @@ class CreateArrayAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,8 +53,7 @@ public class CycleGroupAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,8 +68,7 @@ class DataAction extends ListingContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
DataType getDataType() {
|
||||
|
|
|
@ -54,8 +54,7 @@ public class ChooseDataTypeAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,8 +51,7 @@ class CreateArrayAction extends ListingContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,8 +53,7 @@ public class CycleGroupAction extends ListingContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,8 +66,7 @@ class DataAction extends ListingContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
void setPopupMenu(String name, boolean isSignatureAction) {
|
||||
|
|
|
@ -51,8 +51,7 @@ public class FindReferencesToAction extends ListingContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -646,8 +646,7 @@ class GhidraScriptActionManager {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -73,8 +73,7 @@ public class ShowSymbolReferencesAction extends SymbolTreeContextAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -90,8 +90,7 @@ public class DeleteTableRowAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,8 +54,7 @@ public abstract class MakeProgramSelectionAction extends DockingAction {
|
|||
return;
|
||||
}
|
||||
|
||||
// we don't have a default keybinding, so any value implies user-defined
|
||||
setUnvalidatedKeyBindingData(new KeyBindingData(keyStroke));
|
||||
setKeyBindingData(new KeyBindingData(keyStroke));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -199,17 +199,6 @@ public class DockingToolActionManager implements PropertyChangeListener {
|
|||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
// note: we only use the action name for the lookup, as all shared actions are owned
|
||||
// by the 'Tool'
|
||||
int index = fullName.indexOf(" (Tool)");
|
||||
if (index > 0) {
|
||||
String actionName = fullName.substring(0, index);
|
||||
SharedStubKeyBindingAction sharedAction = sharedActionMap.get(actionName);
|
||||
if (sharedAction != null) {
|
||||
list.add(sharedAction);
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
|
@ -236,6 +225,7 @@ public class DockingToolActionManager implements PropertyChangeListener {
|
|||
}
|
||||
}
|
||||
|
||||
// these are the 'shared' actions that are needed in order to appear in the options UI
|
||||
for (DockingActionIf action : sharedActionMap.values()) {
|
||||
if (owner == null || action.getOwner().equals(owner)) {
|
||||
matchingActionList.add(action);
|
||||
|
@ -322,4 +312,8 @@ public class DockingToolActionManager implements PropertyChangeListener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
DockingActionIf getSharedStubKeyBindingAction(String name) {
|
||||
return sharedActionMap.get(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,8 +301,9 @@ public class SharedKeybindingDockingActionTest extends AbstractDockingTest {
|
|||
//==================================================================================================
|
||||
|
||||
private void assertSharedStubInTool() {
|
||||
// the stub action's name is 'Shared Action Name (Tool)'
|
||||
DockingActionIf action = getAction(tool, SHARED_OWNER, SHARED_NAME);
|
||||
DockingToolActionManager actionManager =
|
||||
(DockingToolActionManager) getInstanceField("actionMgr", tool);
|
||||
DockingActionIf action = actionManager.getSharedStubKeyBindingAction(SHARED_NAME);
|
||||
assertNotNull("Shared action stub is not in the tool", action);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue