Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.1
-
None
Description
Registering a key-related input action with Swing is a two liner
actions { action(id: "viewScriptAction", name: "View", mnemonic: "V", accelerator: shortcut("V"), keyStroke: shortcut("ENTER"), shortDescription: "View selected Script", closure: controller.viewScript) } ... scriptsTable.getInputMap(JComponent.WHEN_FOCUSED).put(shortcut("ENTER"), "viewScript") scriptsTable.actionMap.put("viewScript", viewScriptAction)
It should be possible to create a method that makes this task easier and more intuitive like
keyStrokeAction(scriptsTable, keyStroke: shortcut("ENTER"), action: viewScriptAction)
Note: this feature has been prototyped on the Griffon codebase