Skip to main content

JavaHelp V2.0_02 New Features

Posted by brinkley on November 4, 2004 at 10:22 AM PST

I've been looking for a good topic to start my blog and I finally found one. While most people in the JavaDesktop Community will recognize my name as the JavaDesktop Community Leader, I have a another job at Sun as the lead engineer on JavaHelpTM software. It's a project that I've been involved with since inception and greatly enjoy.

Yesterday Sun released JavaHelp V2.0_02 for general use at the java.sun.com javahelp website. This is generally speaking an bug fix release but there are couple of new features in this release that are worth noting.

Alternative Content Viewer Support

In this release developers now have the option of using an alternative content viewer. Additionally, support for the JDIC native browser is built in. While support for the JDIC native browser is built in, the developer will need to properly install JDIC before it can be used. However once installed properly a simple method call, illustrated below, will cause the native browser to used.


    import javax.help.SwingHelpUtilities;
    ...
    SwingHelpUtilities.setContentViewerUI
        ("javax.help.plaf.basic.BasicNativeContentViewerUI");

Alternative content viewer developers are encouraged to develop alternative content viewer user interfaces. Using the source from BasicNativeContentViewerUI I suspect it will take developers no more than 30 minutes to an hour to provide support for alternative viewers. I've include a list of changes below to help simplify the integration.

  1. Change
    
        import org.jdesktop.jdic.browser.WebBrowser;
    

    to import your viewer instead of the JDIC viewer.

  2. Change "WebBrowser" in the following line
    
        private WebBrowser html;
    

    to use your content viewer class. Keep the "html" variable name as it is used throughout the code and will help isolate the additional changes
  3. Change the JDIC instantiation method
    
        html = new WebBrowser();
    

    to your instantiation method.
  4. Change all the "html" method calls to your own. With any luck they will be the same. Specifically review the following calls:

    • getAccessibleContext()

    • setDebug(boolean)

    • setURL(URL)

    • refresh()
  5. Provide support for the following propertyChangeEvents if your viewer supports them.

    • font

    • clear

    • reload




Finally, at the current time we won't be able to handle highlighting of search text. At some future time that support will be available at which time a change to hightlightsChanged will be required.


All in all this should make integration of alternative content viewers easy for either content viewer developers or application developers.


GTK Look and Feel Support


In previous releases we only had support for one Look and Feel. Generally this wasn't a problem because we used the look and feel from application as it applied to Swing. The only real look and feel item was our images which remained consistent for each look and feel. With this release we have provide support specifically for the GTK Look and Feel and are using images that are consistent with the GTK Look and Feel. To activate the system look and feel your application needs to set the UIManager to the system look and feel as show below:



    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Displaying Help on Multiheaded Systems

While this generally isn't a problem for most users as help will be displayed on the head that the application is running on, there was a need to provide the ability the display online help on a specific screen. With that in mind the following APIs have been added to provide multiheaded support

  • public void HelpBroker.setScreen(int)

  • public int HelpBroker.getScreen()

  • public void WindowPresentation.setScreen(int)

  • public int WindowPresentation.getScreen(int)

General Availability

Finally, in Solaris 10 and on the next major release of the JavaDesktop Operating System JavaHelp will be installed by default. It will no longer be necessary to install the Solaris JavaHelp package or the JDS JavaHelp RPM on those operating systems. However, because JavaHelp is still independent of the JRE it will be necessary to reinstall the packages if a new JRE or JDK is installed on either Solaris or JDS. It's an unfortunate consequence resulting from the recent ability to have multiple JREs.

Concluding Thoughts

This release is really taking a major step forward in the presentation of online help. If you have any questions about these new features you can ask them in the JavaHelp section of the JavaDesktop Forums.

Related Topics >>