Package org.ananas.mac.menu

This package abstracts the MacOS application menu.

See:
          Description

Interface Summary
ApplicationItem A system-independent interface for "application-smart" menu items. An "application-smart" menu item is a menu item that will appear in in the application menu under MacOS.
 

Class Summary
ApplicationItemFactory This class provides a set of methods to create "application-smart" menu items. An "application-smart" menu item is a menu item that will appear in in the application menu under MacOS.
 

Package org.ananas.mac.menu Description

This package abstracts the MacOS application menu. The application menu is special because the OS manages the Quit, About and Preferences menu.

Of course most applications already have those menus but if you want your application to be a good Mac citizen, it should place them in the application menu.

The library abstracts all this. It lets you create "ApplicationItem" that will either register in the application menu, if running on MacOS, or register in the menu bar if running on other platforms.

You may want to check the samples in the org.ananas.mac.menu.demo package.

Recompiling and Deploying

The library references Apple-specific classes in the com.apple.mrj package. Unfortunately, neither AWT nor Swing offer a portable way to access the application menu.

To recompile this package, you will need access to the Apple classes. In practice it means one of the following:

Note you only need those classes to recompile the project. If you are happy with the compiled version I supply, you do not need to include anything. The library works on any VM (it takes advantage of late binding and only loads the Apple-specific classes on a Mac).

Finally note that support for the preference menu was added JDK 1.3.1 only.

Copyright and Licensing

© 2003, Benoît Marchal. All rights reserved.
Distributed under the artistic license (open source).
See www.ananas.org for licensing information.