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.
(seen in rainier product that uses 3.5.1 as base) Rename a file popup has New Name label and whose mnemonic is N But since there is not '&' in that label, it will use first letter of the string as the mnemonic, but when this string is translated, the first letter is not N and is some multibyte one, so mnemonic does not work. Can the & be placed in this label ? Also, could all mnemonics that use this method be reviewed to make sure '&' is present
Created attachment 11239 [details] image of the popup
Rename action uses CTL_RenameLabel from org.openide.actions.Bundle.properties. Should mnemonic ('&') be put at first char? ("&New Name:")? Should this be fixed only at main trunk? Generaly it is not possible to check all labels. > Also, could all mnemonics that use this method be > reviewed to make sure '&' is present Sorry I do not understand what do you mean by that. What 'all mnemonics'? What method? NbPresenter.notify() method is usualy used to display such dialogs but it is not clear generaly what is content of such dialog and if there is any label which should have mnemonic.
In this case it would be possible for NotifyDescriptor.InputLine to check first parameter of constructor (which is label, second parameter is title) contains '&'. I hope it is what you meant. These strings are localized. It means to check what bundle key is used and check bundle key itself for every localization. I can do that for default english. It is part of OpenIDE API => it is necessary to search whole codebase.
Marek, I think what you have in your second comment on this is what I meant. As far as I know, there are 2 ways that mnemonics are implemented - using the '&' -using 2 key/values, one with actual mne letter and one with the associated label. That is great that API can test if a mnemonic that uses '&' actually has one in its value of that key; I had wanted to do this for i18n testing by searching code base but since there is no uniform naming in all modules of the key whose label have (or should have) the '&', it seemed not possible to do. Also, for checking the ones that have the 2 key/val pairs for mne letter and its label, since there is no universal naming of the keys. --- About api method you mention, can you summarize steps needed and I will write up something and send suggestion to all development teams about how to do this checking. ken.frank@sun.com 08/11/2003
To get all occurrences of InputLine I used (Linux): find /home/ms124458/local/netbeans/nbsrc_test -name '*.java' -print | xargs grep -n 'NotifyDescriptor.InputLine' > input Then it is necessary to check all usage of InputLine and check its parameters. I attach result on current main trunk (modules from 'standard' set)
Created attachment 11274 [details] Occurrences of InputLine in NB codebase
I checked openide/core occurrences: Missing '&': openide/loaders/src/org/openide/loaders/DataFolder.java:1192 CTL_NewFolderName=Name: Missing openide/loaders/src/org/openide/loaders/DataTransferSupport.java:161 SerializeBean_Text=&Name of file to serialize the instance to OK openide/src/org/openide/actions/RenameAction.java:67 CTL_RenameLabel=New Name: Missing core/windows/src/org/netbeans/core/windows/MenuFolderNode.java:103 CTL_newMenuLabel=Name: Missing core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:102 PROP_newToolbarLabel=Name: Missing core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:134 PROP_newToolbarConfigLabel=Name; Missing In addition here is probably incorrectly semicolon core/windows/src/org/netbeans/core/windows/nodes/WorkspaceNewType.java:55 NewWorkspaceLabel=New Workspace Missing core/windows/src/org/netbeans/core/windows/toolbars/ToolbarConfiguration.java:705 PROP_saveLabel=&Name: OK Should all those cases be fixed? Should all be first char?
?? Please what shoudl I do? Should I fix only Rename file or should I fix all missing '&' for InputLine usage in openide/core? If all how? All '&' should be added for first char in label? If you will not respond I will fix only Rename. Thanks.
I discussed with Jano Rojcek (CCing him): In english: You can either set mnemonic with ampersand explicitely or leave it without ampersand. In such case InputLine assigns mnemonic to first char of label. In localized bundle: If behaviour as described above is incorrect localizators MUST explicitely add ampersand to localized bundle key to assign some other mnemonic than default first char. (It seems to me - I checked source code of InputLine - it is possible to avoid setting mnemonic completely. Is it necessary not to use mnemonic?
Correction to previous comment: It is NOT possible to avoid mnemonic completely in current InputLine (I wrote incorrectly that it IS possible.)
Marek, please fix the following items: openide/loaders/src/org/openide/loaders/DataFolder.java:1192 CTL_NewFolderName=Name: openide/src/org/openide/actions/RenameAction.java:67 CTL_RenameLabel=New Name: core/windows/src/org/netbeans/core/windows/MenuFolderNode.java:103 CTL_newMenuLabel=Name: core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:102 PROP_newToolbarLabel=Name: core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:134 PROP_newToolbarConfigLabel=Name; *Semicolon should be replaced by colon* core/windows/src/org/netbeans/core/windows/nodes/WorkspaceNewType.java:55 NewWorkspaceLabel=New Workspace
Fixed in main trunk.
Ken, could you please verify ? Thanks advance
Lukas, I can verify but can you clarify what the fix is - do the entries that need mnemonics now have the & in front of the letter of the mnemonic, even if mne is first letter of the label ? And if so, for what modules and bundle files of each is this fixed (I'm assuming I can see it in nb3.6 ?) Thanks - Ken ken.frank@sun.com 02/26/2004
it's probably question for Marek or Jano, could you guys clarify ? thanks
My impression is that all occurrences of label in Input Line type dialog has been fixed to contain '&' in property files.
All, here explicitely pointed bundles/keys are fixed for 3.6 - verified Ken, if you find another wrong 'mneminized' label file new issuea gainst appropriate module, thanks in advance.