This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The patch refines the behavior of Actions.SubMenu a bit. If it has >=5 items, and none of them define a specific mnemonic, it generates them automatically: _1_ First item _2_ Second item etc. No API change necessary. Helpful for large sublists. E.g.: - View | Documentation Indices (when you have many mounts: try apisupport/apidocs) - create an XML layer (w/ apisupport), make folder Menu/Foo, select Foo, right-click and choose Install... (lets you pick existing menus to install between) Maxym: the mnemonics are localizable so they could be switched for Russian to use Cyrillic rather than Latin characters. The first ten are digits anyway.
Created attachment 8613 [details] Suggested patch
Adding A11Y keyword only because it speeds up KB navigability, but this might not be enough reason.
Correction to patch: the whole block if (autoMnemonicIndex >= autoMnemonicText.length()) { // Past the end, skip it - but pad text a bit. // (Padding is approximate since the font is probably proportional anyway.) label = " " + label; // NOI18N } else { label = "&" + autoMnemonicText.charAt(autoMnemonicIndex++) + ' ' + label; // NOI18N } should be enclosed in: if (autoMnemonic) { // as before... }
Created attachment 8616 [details] Corrected patch
Try clicking nbbuild/build.xml and select Run Target... - that gets mnemonics too.
Jesse, you wanted to know my opinion, you get it: Perfect.
To Maxym: actually I was CCing you in case you wanted to check whether a Cyrillic version of MNEM_submenu_items would make sense for Bundle_ru.properties, or whether it should better use the Latin accelerator keys. Depends on whether Russian-language users would typically have a Cyrillic keyboard configuration; I remember you dealing with this question w.r.t. menu mnemonics. But thanks for the evaluation too. :-)
Hmm, I'm not so sure if this patch is suitable for users. For users it will seem that mnemonics appear "magically", they will IMO have troubles to understand conditions under which mnemonics are automatically generated --> user confusion and feeling "not in control". Please consider consulting with HIE and/or show me that I'm wrong. Thx.
Assigned to new owner.
Jesse, if you want to move this forward, write some test and integrate it yourself.
Would still be useful in Set Main Project, Open Recent File, Open Recent Project, Project Group, and Javadoc References submenus. But better to activate on demand only, using some kind of utility, e.g. JMenu menu = new JMenu("Set Main Project"); menu.add(new JMenuItem("&None")); menu.addSeparator(); for (Project p : ...) { Actions.addToLongMenu(menu, new JMenuItem(p.displayName))); } where the utility method would append the menu item to the menu; assign it the next available mnemonic in sequence (in this example skipping over 'N' since it is already in use); and in case the menu grows too long to display comfortably, creates a new cascading submenu (mnemonic '.' perhaps) to hold subsequent items, as in the Insert Unicode action, also serving as a possible replacement for hacks like the "More Javadoc..." item under "Javadoc References".
*** Bug 136749 has been marked as a duplicate of this bug. ***