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 70944

Summary: Mnemonics in NBM projects
Product: guibuilder Reporter: Tomas Pavek <tpavek>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker CC: jglick, mmirilovic
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 213683    
Bug Blocks:    

Description Tomas Pavek 2006-01-03 13:44:58 UTC
Inspired by issue 70911...

Using mnemonics (org.openide.awt.Mnemonics) is desirable in NetBeans module
projects. We should consider turning them on by default in this case. Also
dependency on utilities module (org.openide.awt) should be added automatically
(as suggested in issue 70911).

Perhaps it could work the way that when a new form is created (which has not the
mnemonics option set yet) and assuming the global mnemonics option is true, we'd
try to add org.openide.awt to classpath, then check if Mnemonics class is there
and if yes, then set the given form's mnemonics to true, otherwise to false.

This way forms created in NBM projects would use mnemonics by default and
standard java projects would not (only in the case thay have Mnemonics on
classpath added manually).
Comment 1 Jesse Glick 2006-01-04 17:12:46 UTC
That's one option. Here's another: make it work much like swing-layout. So
concretely:

1. Leave the Mnemonics flag off for regular forms. Leave the Mnemonics flag on
for NBM-related forms, but roll back issue #70911 (i.e. do not forcibly add a
dep on org.openide.awt to modules for forms which do not already use Mnemonics;
the New Project Template form does already use Mnemonics so this wizard would
continue to add a dep on org.openide.awt, as it did independently of #70911).

2. Make a j2se-type library containing just the Mnemonics class and ship it with
the IDE, including sources.

3. Change the form editor to detect when (1) a form is created which is already
set to call Mnemonics on at least one label/button, or (2) a label/button on an
existing form is modified to include text which would involve a Mnemonics call;
and in such cases to request that ProjectClassPathExtender add the new library.

3a. You might want to actually check the value of the text string (whether
hardcoded or from bundle) - include a call to Mnemonics if and only if the text
string actually includes an ampersand. This would avoid gratuitous calls.

4. Enhance apisupport's ProjectClassPathExtender to add a dep on org.openide.awt
in place of adding the new library. (No change would be needed for j2seproject.)
Comment 2 Tomas Pavek 2006-07-31 08:36:03 UTC
*** Issue 81376 has been marked as a duplicate of this issue. ***
Comment 3 Tomas Pavek 2006-12-04 17:22:04 UTC
*** Issue 90402 has been marked as a duplicate of this issue. ***
Comment 4 Tomas Pavek 2007-05-21 17:52:01 UTC
*** Issue 103860 has been marked as a duplicate of this issue. ***