mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 22:59:04 +08:00
GT-2869 - Shared Key Bindings - review fixes
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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() {
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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) {
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
+5
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user