Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 98432 - Some platform apps cannot use ide/applemenu because of dependencies on editor
Some platform apps cannot use ide/applemenu because of dependencies on editor
Product: ide
Classification: Unclassified
Component: Code
All All
: P2 (vote)
: 6.x
Assigned To: issues@ide
Depends on:
  Show dependency treegraph
Reported: 2007-03-21 10:16 UTC by _ tboudreau
Modified: 2007-04-16 10:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT

Patch removing editor dependencies from ide/applemenu (13.32 KB, patch)
2007-03-21 10:29 UTC, _ tboudreau
Details | Diff
Module to unzip into ide/applemenu (also delete the keybinding xml files from ide/applemenu) (9.49 KB, application/octet-stream)
2007-03-21 10:30 UTC, _ tboudreau
Improved ide/applemenu/editor (category & descriptions added) (17.42 KB, application/octet-stream)
2007-03-27 19:51 UTC, _ tboudreau
Patch to nbbuild to move ide/applemenu to platform cluster and ide/applemenu/editor to an appropriate place (948 bytes, patch)
2007-03-27 19:52 UTC, _ tboudreau
Details | Diff
Diff to ide/ including changes in golden deps files (14.77 KB, application/octet-stream)
2007-03-27 20:49 UTC, _ tboudreau

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2007-03-21 10:16:55 UTC
ide/applemenu provides Mac-OS specific keybinding customizations and support for
apple-specific things like Mac-OS application events.

It also customizes the keybindings for the editor.  This causes an unfortunate
dependency on some editor stuff that many apps don't need.  The editor-specific
customizations should be split out into a separate module.
Comment 1 _ tboudreau 2007-03-21 10:29:06 UTC
Created attachment 39741 [details]
Patch removing editor dependencies from ide/applemenu
Comment 2 _ tboudreau 2007-03-21 10:30:31 UTC
Created attachment 39742 [details]
Module to unzip into ide/applemenu (also delete the keybinding xml files from ide/applemenu)
Comment 3 _ tboudreau 2007-03-21 10:31:27 UTC
The attached patches need testing on a mac, but should do the job.  Only other
thing should be to add it to nbbuild.
Comment 4 Torbjorn Norbye 2007-03-21 15:33:53 UTC
I guess we need a new bridge module which bridges ide/applemenu and java/editor providing the java 
specific keybindings?
Comment 5 _ tboudreau 2007-03-21 20:28:16 UTC
Pretty much.  That's what the zip attachment is (though not marked as eager).
Comment 6 _ tboudreau 2007-03-27 19:51:16 UTC
Created attachment 40053 [details]
Improved ide/applemenu/editor (category & descriptions added)
Comment 7 _ tboudreau 2007-03-27 19:52:11 UTC
Created attachment 40054 [details]
Patch to nbbuild to move ide/applemenu to platform cluster and ide/applemenu/editor to an appropriate place
Comment 8 _ tboudreau 2007-03-27 19:53:58 UTC
I'd be happy to integrate this;  I'm not sure anyone looks at issues filed
against the ide component in IZ.

Adding Jarda to cc since this change affects the contents of the platform and
other clusters, and I'm not sure if that means we need to rev the version number
for that or something such.

Jarda, could you review the nbbuild patch?
Comment 9 _ tboudreau 2007-03-27 20:07:56 UTC
Well, one problem with it:  I get a popup message that no module providing the
capability org.openide.modules.os.MacOSX is installed.

Any idea how to make that go away (or why ide/applemenu does fail silently but
this module doesn't - is something hardcoded somewhere?).
Comment 10 _ tboudreau 2007-03-27 20:49:39 UTC
Created attachment 40055 [details]
Diff to ide/ including changes in golden deps files
Comment 11 Jaroslav Tulach 2007-03-29 08:45:35 UTC
Y01 Move ide/applemenu to core/applemenu - traditionally 
contains things that go to nbX.Y cluster. Moreover right now platform is 
placed in core,openide,projects,libs,nbbuild and nowhere else. That is why I 
suggest to move the platform part into core.

Y02 Would not it be better to work on a branch in CVS?

Comment 12 Vitezslav Stejskal 2007-03-30 00:17:01 UTC
The editor keybindings files don't have to be placed in ide/applemenu anymore.
They can go to their respective modules (editor and java/editor). In fact the
ide/applemenu no longer depends on editor and java/editor modules and the only
reason why I didn't move the keybindings files was that I tried to minimize my

So, if people are happy with it I'll move the kebindings files to editor and
java/editor modules. Then ide/applemenu will only contain general (core) stuff
and we can add it to the platform.

Re. moving ide/applemenu to core/applemenu - I don't really care, but imo it is
not neccessary. Btw. editor/mimelookup is part of the platform too.
Comment 13 Torbjorn Norbye 2007-03-30 00:44:03 UTC
Hi Vita,
can you explain what a module owner needs to do to add Mac-specific keybindings to his/her module?

Let's say I have an action named "foo" which I want to map to Alt-G on all platforms but Shift-Command-X 
on Mac. What do I put in my keybindings xml file?
Comment 14 Vitezslav Stejskal 2007-03-30 01:18:55 UTC
The editor/settings/storage module now supports platform specific files. The
full description is in the module's arch document. Unfortunately, I just noticed
that this module's javadoc is not published on, so I'll briefly explain
it here and publish the javadoc later (or you can generate it locally if you want).

Basically, you need to place Mac specific keybindings to an extra file and mark
that file with nbeditor-settings-TargetOS attribute. The value of this attribute
is the string name of one of the OS_* constants in o.o.util.Utilities class. Any
file with this attribute is ignored on platforms that do not match the
attribute, if the platform matches the file will be loaded, but *after* loading
all platform independent files first. So, in your example the file would contain
something like:

    <bind key="O-G" remove="true"/>
    <bind key="S-M-X actionName="foo"/>

and in the layer the file would be defined like:

<file name="whatever-you-like.xml" url="...">
    <attr name="nbeditor-settings-TargetOS" stringvalue="OS_MAC"/>
Comment 15 _ tboudreau 2007-03-30 03:19:57 UTC
And this mechanism lets you not only add/change keybindings, but also delete
keybindings?  I can't offhand think of any we need to be able to delete for Mac
OS, but it would be good to know if this is a complete solution.

Please do remove the keybindings files from ide/applemenu if they really don't
need to be there.

Comment 16 Vitezslav Stejskal 2007-03-30 03:37:54 UTC
Yes, you can remove keybindings. The previous example *removes* 'O-G' keybinding
and *adds* 'SM-X' keybinding. These two operations are independent of course.

Ok, I'll move the files.
Comment 17 Vitezslav Stejskal 2007-03-30 04:30:22 UTC
Files moved.

RCS file:
Checking in
 <--  DefaultKeyBindings-Mac.xml
initial revision: 1.1
Checking in
/cvs/java/editor/src/org/netbeans/modules/java/editor/resources/layer.xml,v  <--
new revision: 1.22; previous revision: 1.21
 <--  AllEditorsKeyBindings.xml
new revision: delete; previous revision: 1.1
Checking in dev/ide/applemenu/src/org/netbeans/modules/applemenu/layer.xml;
/cvs/ide/applemenu/src/org/netbeans/modules/applemenu/layer.xml,v  <--  layer.xml
new revision: 1.13; previous revision: 1.12
Removing dev/ide/applemenu/src/org/netbeans/modules/applemenu/JavaKeyBindings.xml;
/cvs/ide/applemenu/src/org/netbeans/modules/applemenu/JavaKeyBindings.xml,v  <--
new revision: delete; previous revision: 1.1
Checking in dev/editor/src/org/netbeans/modules/editor/resources/layer.xml;
/cvs/editor/src/org/netbeans/modules/editor/resources/layer.xml,v  <--  layer.xml
new revision: 1.90; previous revision: 1.89
RCS file:
Checking in
 <--  NetBeans-keybindings-mac.xml
initial revision: 1.1
Comment 18 Jaroslav Tulach 2007-04-16 10:14:25 UTC
So I guess the dependencies are ok. I have moved the module to platfrom as 
part of issue 96221.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo