eirikbakke commented on code in PR #5336:
URL: https://github.com/apache/netbeans/pull/5336#discussion_r1150656139
##########
platform/openide.awt/src/org/openide/awt/Actions.java:
##########
@@ -128,25 +129,100 @@ private static String findKey(Action action) {
return null;
}
- KeyStroke accelerator = (KeyStroke)
action.getValue(Action.ACCELERATOR_KEY);
+ KeyStroke stroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY);
- if (accelerator == null) {
+ if (stroke == null) {
return null;
}
- int modifiers = accelerator.getModifiers();
- String acceleratorText = ""; // NOI18N
+ return keyStrokeToString(stroke);
+ }
- if (modifiers > 0) {
- acceleratorText = KeyEvent.getKeyModifiersText(modifiers);
- acceleratorText += "+"; // NOI18N
- } else if (accelerator.getKeyCode() == KeyEvent.VK_UNDEFINED) {
- return ""; // NOI18N
+ // Based on com.formdev.flatlaf.getMacOSModifiersExText.
Review Comment:
Meant com.formdev.flatlaf.ui.FlatMenuItemRenderer.getMacOSModifiersExText
here in the comment... will fix before merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists