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

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
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo