Skip to main content

Upgrading from 1.1.3 to 2_0_01: lost jhelp

1 reply [Last post]
Anonymous

In 1.1.3, DefaultHelpBroker had a protected member
variable JHelp jhelp, from which subclasses could access
the JHelpNavigators via JHelp.getHelpNavigators().

In 2_0_01, this is gone, and the JHelp object on
WindowPresentation is private with no accessors.

We previously used this access to access the JTree in the
JHelpTOCNavigator and update its UI and change its cell
renderer. Now we can no longer do this.

Is there a preferred way to access the JHelp object in
2_0_01 or are we just out of luck?

Thanks,

: jay

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Roger Brinkley

jay wrote:
> In 1.1.3, DefaultHelpBroker had a protected member
> variable JHelp jhelp, from which subclasses could access
> the JHelpNavigators via JHelp.getHelpNavigators().
>
> In 2_0_01, this is gone, and the JHelp object on
> WindowPresentation is private with no accessors.
>
> We previously used this access to access the JTree in the
> JHelpTOCNavigator and update its UI and change its cell
> renderer. Now we can no longer do this.
>
> Is there a preferred way to access the JHelp object in
> 2_0_01 or are we just out of luck?

I wish I had never made these entries protected in the first place.
That's why in WindowPresentation they reverted back to private. You can
get access to the WindowPresentation and then the Window its self. From
there you can traverse though the hierarchy to get to the JTree component.

Of course you realize that even in the old implementation you were going
well beyond the scope of API and were subject to internal changes that
may occur. This would also be the case with the new V2.0 API (assuming
you can get to the JTree component). A better approach would be to write
a custom UI for the JHelpTOCNavigator. Then it doesn't matter what
changes we make internally. While your change in the cell renderer
appears to be minor this is probably the better approach.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.