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).
That's one option. Here's another: make it work much like swing-layout. So
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.)
*** Issue 81376 has been marked as a duplicate of this issue. ***
*** Issue 90402 has been marked as a duplicate of this issue. ***
*** Issue 103860 has been marked as a duplicate of this issue. ***