Fixed tests failing due to focus timing issues by allowing the test

framework to specify the source of key bindings
This commit is contained in:
dragonmacher 2020-03-13 16:50:54 -04:00
parent 3418492a8c
commit 3f62f91a2e
5 changed files with 71 additions and 10 deletions

View file

@ -354,9 +354,9 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
}
/**
* Get the window which contains the specified Provider's component.
* Get the window that contains the specified Provider's component
* @param provider component provider
* @return window or null if component is not visible or not found.
* @return window or null if component is not visible or not found
*/
public Window getProviderWindow(ComponentProvider provider) {
ComponentPlaceholder placeholder = getActivePlaceholder(provider);
@ -366,6 +366,24 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
return null;
}
/**
* Get the provider that contains the specified component
* @param c the component
* @return the provider; null if now containing provider is found
*/
public ComponentProvider getProvider(Component c) {
if (c != null) {
DockableComponent dc = getDockableComponent(c);
if (dc != null) {
ComponentPlaceholder placeholder = dc.getComponentWindowingPlaceholder();
if (placeholder != null) {
return placeholder.getProvider();
}
}
}
return null;
}
ComponentPlaceholder getActivePlaceholder(ComponentProvider provider) {
return placeholderManager.getActivePlaceholder(provider);
}