Package org.openstreetmap.josm.gui.util
Class RedirectInputMap
java.lang.Object
javax.swing.InputMap
javax.swing.ComponentInputMap
org.openstreetmap.josm.gui.util.RedirectInputMap
- All Implemented Interfaces:
Serializable
Make shortcuts from main window work in dialog windows.
It's not possible to simply set component input map parent to be Main.contentPane.getInputMap
because there is check in setParent that InputMap is for the same component.
Yes, this is a hack.
Another possibility would be simply copy InputMap, but that would require to
keep copies synchronized when some shortcuts are changed later.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRedirectInputMap(JComponent component, InputMap target) Create a newRedirectInputMap -
Method Summary
Modifier and TypeMethodDescriptionallKeys()voidclear()keys()voidstatic voidredirect(JComponent source, JComponent target) Redirects the key inputs from one component to an other componentvoidintsize()Methods inherited from class javax.swing.ComponentInputMap
getComponent, setParent
-
Field Details
-
target
-
-
Constructor Details
-
RedirectInputMap
Create a newRedirectInputMap- Parameters:
component- The component the input map will be added totarget- The target input map that should be mirrored.
-
-
Method Details
-
get
-
keys
-
size
-
allKeys
-
put
- Overrides:
putin classComponentInputMap
-
remove
- Overrides:
removein classComponentInputMap
-
clear
- Overrides:
clearin classComponentInputMap
-
redirect
Redirects the key inputs from one component to an other component- Parameters:
source- The source componenttarget- The target component to send the keystrokes to.
-