(5) Integrate the Booklet with Your Application

After your booklet is converted properly, you can work with your programmers to integrate context-sensitive help with the application. On the iMaven project, I documented the steps in this process and included these steps in a programmer's guide for the project. This way, if programmers needed to know how to hook up context-sensitive help for a dialog box that they developed, I could refer them to the programmer's guide. These steps are summarized below.

Set up Jelp. For programmers to set up their workstation to run Jelp, they created a Jelp directory on their local machine and copied the jelpviewer.zip file to this newly created directory. They also had to properly set their CLASSPATH as discussed previously.

Copy the actual help files. After setting up their Jelp environment, the programmers could then copy the booklet directory and all its files to their Jelp directory. On the iMaven project, we used StarTeam, a source code management system. After I checked the help files into this system, they could check them out into their Jelp directory.

Modify your code. In the code that contains Help button functionality, the programmers needed to do the following:

  1. In the import statement area of the code, add:

    //Standard Jelp Classes
    import com.createsoft.jelp.viewer.*;

  2. Inside the class, add:
    /**
    * Jelp handle, location, and size variables
    **/
    protected Jelp mavenHelp = new Jelp ("mvnhlp");
    protected static final int HELP_X_LOC = 600;
    protected static final int HELP_Y_LOC = 20;
    protected static final int HELP_WIDTH = 400;
    protected static final int HELP_HEIGHT = 450;

  3. Inside the performHelpAction method, add:

    mavenHelp.showHelp (Jelp.DEFAULT, "topic_name",
    HELP_X_LOC, HELP_Y_LOC,
    HELP_WIDTH, HELP_HEIGHT);

    where "topic_name" is the name of the topic associated with the dialog box.

Integrate the JelpViewer with the main application window. To integrate the JelpViewer with the main window (so it would display after the user clicks the Help Topics command), our programmers needed to do the following:

  1. Import the Jelp class:

    import com.createsoft.jelp.Viewer.Jelp;

  2. Create a Jelp object:

    Jelp jelp = new Jelp ("mvnhlp");

    where "mvnhlp" is the name of the booklet.
  3. Call the help booklet or class:

    Dimension screen = getToolkit().getScreenSize();
    int helpWidth = screen.width/2;
    int helpHeight = screen.height/2;
    jelp.showHelp (jelp.DEFAULT, helpWidth/2, helpHeight/2, helpWidth, helpHeight);

Step 1 | Step 2 | Step 3 | Step 4 | Step 5
Return to the Main article