Skip to main content

Context-Sensitive and merged helpsets

1 reply [Last post]
Anonymous

Hi!

I have a big problem and am hoping that someone out there can help me.

Background:

* I have a master helpset with several statically merged subhelpsets.
* I only use the TOC view and I want context-sensitive help.
* My application is an MDI based Swing application.

Problem:

* To simplify matters for all the developers working on this project, the
helpset is loaded from the main class and the enableHelpKey method is
called on the rootpane of the JFrame on the master helpset.
* All JInternalFrames that the developers produce, call
CSH.setHelpIdString on their components. This actually works to some
extent. When the F1 key is pressed on one of the components in an
internal frame, the help window pops up and the correct help text is
displayed. However, the corresponding node in the TOC is not selected.
I went through the source code of JavaHelp (2.0_01) and realized that
the comparison when deciding what node in the TOC tree to select not
only depends on the help ID string, but also on the helpset. This seems
a bit odd, since JavaHelp obviously finds the correct target, but seems
to be more picky when it tries to select a node in the TOC.

Possible solutions:

* I could of course tell all the developers that they also have to call
CSH.setHelpSet on all their components and somehow pass their helpset,
but since all helpsets are already loaded and merged, that seems out of
the question.
* We could merge the helpsets manually and just use one huge helpset,
since all ID's are unique anyway, due to a pre-defined structure. But
who wants to do that?
* The solution that seems most appealing right now is to modify the source
code of either the javax.help.Map.ID.equals method or the
BasicTOCNavigatorUI.findID method, but is that even allowed?

Does anyone have any other suggestions?

What I REALLY would want is for Sun to rewrite the code so that the
developer can switch off the unqiue ID per helpset policy and enforce
unique ID for the entire collection of helpsets.

Thankful for any comments or suggestions

/Fredric Dahlqvist

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

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.

Reply viewing options

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

Fredric Dahlqvist wrote:

> Hi!
>
> I have a big problem and am hoping that someone out there can help me.
>
> Background:
>
> * I have a master helpset with several statically merged subhelpsets.
> * I only use the TOC view and I want context-sensitive help.
> * My application is an MDI based Swing application.
>
> Problem:
>
> * To simplify matters for all the developers working on this project, the
> helpset is loaded from the main class and the enableHelpKey method is
> called on the rootpane of the JFrame on the master helpset.
> * All JInternalFrames that the developers produce, call
> CSH.setHelpIdString on their components. This actually works to some
> extent. When the F1 key is pressed on one of the components in an
> internal frame, the help window pops up and the correct help text is
> displayed. However, the corresponding node in the TOC is not selected.
> I went through the source code of JavaHelp (2.0_01) and realized that
> the comparison when deciding what node in the TOC tree to select not
> only depends on the help ID string, but also on the helpset. This seems
> a bit odd, since JavaHelp obviously finds the correct target, but seems
> to be more picky when it tries to select a node in the TOC.
>
> Possible solutions:
>
> * I could of course tell all the developers that they also have to call
> CSH.setHelpSet on all their components and somehow pass their helpset,
> but since all helpsets are already loaded and merged, that seems out of
> the question.
> * We could merge the helpsets manually and just use one huge helpset,
> since all ID's are unique anyway, due to a pre-defined structure. But
> who wants to do that?
> * The solution that seems most appealing right now is to modify the source
> code of either the javax.help.Map.ID.equals method or the
> BasicTOCNavigatorUI.findID method, but is that even allowed?

No...the license prevents that

> Does anyone have any other suggestions?

It's a bug. It should work are you think it should work. File a bug
report with a small example that duplicates the problem. Use the Animals
merge demo if you need an example.

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.