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.

Bug 27001

Summary: Hard-coded mnemonics
Product: projects Reporter: _ mihmax <mihmax>
Component: Generic InfrastructureAssignee: issues@projects <issues>
Status: VERIFIED FIXED    
Severity: blocker Keywords: I18N
Priority: P3    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ mihmax 2002-09-04 06:36:07 UTC
Found hard-coded mnemonics in the file 

projects/src/org/netbeans/modules/projects/ProjectManagerPanel.java
        newButton.setMnemonic('N');
        importButton.setMnemonic('I');
        importButton.setMnemonic('I');
        saveAsButton.setMnemonic('V');
        deleteButton.setMnemonic('D');
...

Thanks to Tom Ball who discovered
Comment 1 Vitezslav Stejskal 2002-09-04 08:40:24 UTC
OK, what is the problem with hard-coded mnemonics? How do I have to
fix it? Just point me to some spec describing this, if there is any.
Thanks.
Comment 2 _ mihmax 2002-09-04 09:32:58 UTC
> OK, what is the problem with hard-coded mnemonics?
The problem is that noone can localize it ;(

> How do I have to fix it? 
> Just point me to some spec describing this, if there is any.

instead of:
newButton.setText("New"); 
newButton.setMnemonic('N');

use:
org.openide.awt.Actions.setMenuText(newButton,"&New",true);
// where "&New" is got from a bundle

doc: 
 http://www.netbeans.org/devhome/docs/i18n/index.html
 (it's a bit old ;( )

Comment 3 Vitezslav Stejskal 2003-01-09 18:22:22 UTC
fixed in main trunk
org/netbeans/modules/projects/Bundle.properties: 1.59;
org/netbeans/modules/projects/ProjectManagerPanel.form: 1.15;
org/netbeans/modules/projects/ProjectManagerPanel.java: 1.35;
Comment 4 Milan Kubec 2003-01-21 12:53:50 UTC
Verified.