How to get the shortcut/shortkey of an action at runtime?

Apache NetBeans Wiki Index

Note: These pages are being reviewed.

For example

Action action = FileUtil.getConfigObject("Actions/Source/org-netbeans-modules-editor-hints-FixAction.instance", Action.class);
KeyStroke ks = action != null ? (KeyStroke) action.getValue(Action.ACCELERATOR_KEY) : null;


// localise a keystroke for display
org.openide.util.Utilities.keyToString() // or
org.netbeans.core.options.keymap.api.KeyStrokeUtils.getKeyStrokeAsText() // if a friend of org.netbeans.modules.options.keymap