Demonstration Programs

This release includes a number of demo programs (including source code) and examples. These programs demonstrate JavaHelp system functionality and provide code examples that illustrate how you can implement these features in your JavaHelp systems. Many of these demonstration programs use the sample helpsets.
IDE demo A mockup of an Integrated Development Environment application. The application includes a complete, functional help system.
Object demo A demonstration of how the <OBJECT> tag can be used to embed Java components directly into HTML topic pages. The JavaHelp system includes two components, a popup window and a secondary window.
API viewer A specialized help viewer that includes a navigator that displays JavaHelp system API documentation.
Merge demo A small application that demonstrates the dynamic merging of helpset information.
Newmerge demo An application and a set of help files that demonstrate new features for merging of helpset information, including SorteMerge merging for indexes and glossaries and UniteAppendMerge merging for TOCs.
Browser demo A demonstration of the JavaHelp viewer running in an applet on a web browser.
Search example Source file that describes a simple, alternate implementation of a full-text search engine.
Localized Helpsets Localized demonstration helpsets (English, German, Japanese.
Demo source files Source files for all of the demos can be found in:
    JavaHelp_Home/demos/src
In addition to the locations described below, most of the demo programs are available by executing the JAR files. Depending on your operating system, you might execute a JAR file from the command line or by double-clicking the file's icon in the Windows Explorer. For instance, if your JAR files are set to execute with the Java runtime program java.exe on a Windows operating system, you can double click the jar file in the Explorer to run it.

The demo programs' jar files are located in the demos/bin folder.

IDE Demo

The IDE Demo is a mockup of an IDE (Integrated Development Environment) application that contains a complete, fully-featured help system.

The IDE demo demonstrates the following functionality:
Standard navigators TOC, keyword index, and full-text search navigators.
Synchronization The TOC display is synchronized with the content pane. The topic displayed in the content pane is always highlighted in the TOC.
Content pane Help topics displayed in the content pane contain images, hyperlinks, and other 3.2 HTML tags.
Lightweight Java components The top-level topic "Building Projects" uses the JHSecondaryViewer lightweight component to implement a popup window, and a secondary window. In this topic, click on the blue term "project" to see the popup window and click on the button at the end of the first paragraph to see the secondary window. These components are also demonstrated and described in the Object demo.
Presentation settings The IDE demo has code in its helpset file (IdeHelp.hs) that sets up two presentation windows. It also has entries in its TOC file (IdeHelpTOC.xml) and its index file (IdeHelpIndex.xml) that specify the type of window (the presentation) in which to display the help topic. (For example, see the TOC entry "Beans In JDE - in SecondaryWindow".) For more information on presentations, see the presentation feature in Helpset File and in Implementing Context-Sensitive Help.
Context Sensitive Help The JavaHelp system supports three types of context-sensitive help:
Window-Level Help Place the cursor in different areas of the application and press the F1 key. This activates the help viewer and displays help that describes the GUI object that currently has focus.
Field-Level Help Click the button, then move the field-level cursor over an object in the GUI and click select.
Help Button Choose Edit > Find. Click on the Help button in the dialog box to display a topic about the dialog box.
Custom Navigator Choose Help > Java API Reference to activate the help viewer and load a helpset that includes the customized ClassViewer navigator. The ClassViewer is an example of a navigator that is customized to assist in navigating through javadoc-generated API documentation. The behavior of the ClassViewer is described at API Viewer. It is a fully functional navigator with its own specialized format.
Embedded Help Choose Window > Class Inspector to activate the custom ClassViewer navigator described above and embed it in the application. Note that as you navigate, the corresponding topic is displayed in the lower pane of the application.

To run the IDE demo, enter the following command at the command line:

        java -jar JavaHelp_Home/demos/bin/idedemo.jar

After the demo starts, choose Help > Demo JDE - Help to activate the help viewer.

Object Demo

Lightweight Java components can be added to HTML topic pages using the <OBJECT> tag. The JavaHelp system includes popup and secondary windows implemented using the JHSecondaryViewer component. The object demo shows how popup and secondary windows work.

To run the Object demo, enter the following command at the command line

        java -jar JavaHelp_Home/demos/bin/object.jar

API Viewer

The JavaHelp release includes an API Viewer. This simple application is similar to the helpset viewer, except that the CLASSPATH includes a special ClassViewer navigator. The API Viewer presents javadoc-generated information derived from the JavaHelp source files.

The TOC in the API Viewer (the ClassViewer navigator) includes a top pane and a bottom pane. The top pane displays a list of the classes, interfaces, and exceptions that comprise the JavaHelp system. The bottom pane displays a hierarchy of components of a selected class, interface, or exception. Select a class in the top pane to view its constituent components in the bottom pane. Choose a component in the bottom pane to view it in the content viewer.

The data used by the ClassViewer Navigator is generated using a doclet (doclets are a feature of the JavaTM 2 SDK). The API doclet is not included in this release of the JavaHelp system.

To run the API Viewer demo, enter the following command at the command line:

        java -jar JavaHelp_Home/demos/bin/apiviewer.jar

Merge Demo

Demonstrates JavaHelp system helpset merging capabilities. For details, see the online help available from the Help menu in the merge demo program.

To run the Merge demo, enter the following command at the command line:

        java -jar JavaHelp_Home/demos/bin/merge.jar

Newmerge Demo

Demonstrates JavaHelp system helpset merging capabilities. For details, see the online help available from the Help menu in the newmerge demo program.

To run the Newmerge demo, enter the following command at the command line:

        java -jar JavaHelp_Home/demos/bin/newmerge.jar

Browser Demo

Demonstrates how the JavaHelp system can be used with applet-based applications running in web browsers. You can run demonstration by using either Netscape Navigator or Internet Explorer. The demo creates an applet button on an HTML page. When you click the button, the JavaHelp viewer displays the Holiday helpset. This demo requires some setup. You can find instructions for the demo in the file demos/browser/demo_instructions.

Search Example

The file demos/src/sunw/demo/searchdemo/ClientSearch.java shows how to extend the HelpSearch class to implement an alternate search engine.

Localized Helpsets

Localized demonstration helpsets (English, German, Japanese) for the IDE demo are included in the demos/hsjar folder. Be sure to choose the appropriate font in the JavaHelp viewer's Set Fonts dialog box (choose Options > Set Font).
  You must have installed the appropriate Unicode fonts to be able to view the Japanese helpset.

Also, you use a different command to run helpsets. The command is:

   java -jar hsviewer.jar [-helpset hs_name]

For example (on a Windows system):
   C:\> java -jar c:\JavaHelp\demos\bin\hsviewer.jar
-helpset c:\JavaHelp\demos\hs\newmerge\MergeHelp.hs