mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
Step - Added 'snapshot' concept to base Component Provider to fix how actions are added to the toolbar and menu; fixed bugs and tests
This commit is contained in:
parent
3946a05ded
commit
10621008e0
18 changed files with 291 additions and 84 deletions
|
@ -170,11 +170,13 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
assertProviderKeyStroke(newKs);
|
||||
assertOptionsKeyStroke(newKs);
|
||||
assertMenuItemHasKeyStroke(newKs);
|
||||
assertNoToolbarAction();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetKeyBinding_ViaOptions_WithToolbarAction() {
|
||||
|
||||
setToolbarIcon(ICON);
|
||||
showProvider();
|
||||
|
||||
KeyStroke newKs = CONTROL_T;
|
||||
|
@ -183,6 +185,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
assertProviderKeyStroke(newKs);
|
||||
assertOptionsKeyStroke(newKs);
|
||||
assertMenuItemHasKeyStroke(newKs);
|
||||
assertToolbarAction();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -306,6 +309,14 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
waitForSwing();
|
||||
}
|
||||
|
||||
private void assertNoToolbarAction() {
|
||||
assertNotNull("No toolbar action found for provider", getToolbarShowProviderAction());
|
||||
}
|
||||
|
||||
private void assertToolbarAction() {
|
||||
assertNotNull("No toolbar action found for provider", getToolbarShowProviderAction());
|
||||
}
|
||||
|
||||
private void assertProviderKeyStroke(KeyStroke expectedKs) {
|
||||
|
||||
DockingActionIf action = getShowProviderAction();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue