Version: 1.2

Posted: 2006-04-12

Build Requirements: Xcode 1.5 or later, Java 1.4.2 or later

Runtime Requirements: Mac OS X 10.3 or later, Java 1.4.2 or later

View Source Code:

Download Sample (“HelpHook.zip”, 124.4K)
Download Sample (“HelpHook.dmg”, 187.5K)



Description

This is a very simple example of integrating a J2SE application with the Apple Help Viewer application. A simple Cocoa library calls [NSApplication showHelp], which allows HelpViewer to inspect the application bundle for help content. Also critical are the CFBundleHelpBookFolder and CFBundleHelpBookName keys, added to the application's Info.plist dictionary. (see the HelpHook target in Xcode).

The call to [NSApplication showHelp] is made asynchronously to prevent deadlocks between AWT and AppKit. A badShowHelp function is also written that blocks AWT against this call and under certain circumstances can lead to a deadlock. See the comments in JavaHelpHook.m and Technical Note 2147 for more details.

This sample code has been updated to include a project that produces a universal binary. No code changes were required for it to run correctly on Intel-based Macintosh computers.

Document Revision History

Date Notes
2006-04-12Updated compiler options to generate 1.4 compatible bytecode.
2005-10-04Updated to produce a universal binary. No code changes were required.
2005-02-23Simple Help Viewer integration for J2SE applications, using a native Cocoa library.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.