GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -

test and review fixes
This commit is contained in:
dragonmacher 2019-07-05 12:43:24 -04:00
parent 10621008e0
commit 6015650079
50 changed files with 539 additions and 640 deletions

View file

@ -76,11 +76,7 @@ class ShowComponentAction extends DockingAction implements Comparable<ShowCompon
// keybinding data used to show the binding in the menu
ComponentProvider provider = placeholder.getProvider();
DockingActionIf action = provider.getShowProviderAction();
KeyBindingData kbData = action.getKeyBindingData();
if (kbData != null) {
setKeyBindingData(kbData);
}
synchronizeKeyBinding(provider);
// Use provider Help for this action
HelpLocation helpLocation = provider.getHelpLocation();
@ -94,6 +90,21 @@ class ShowComponentAction extends DockingAction implements Comparable<ShowCompon
}
}
/**
* Ensures that the given provider's key binding matches this class's key binding
* @param provider the provider
*/
private void synchronizeKeyBinding(ComponentProvider provider) {
DockingActionIf action = provider.getShowProviderAction();
KeyBindingData defaultBinding = action.getDefaultKeyBindingData();
setKeyBindingData(defaultBinding);
KeyBindingData kbData = action.getKeyBindingData();
if (kbData != null) {
setUnvalidatedKeyBindingData(kbData);
}
}
private static KeyBindingType createKeyBindingType(boolean isTransient,
ComponentPlaceholder placeholder) {