Skip to main content

RE: [JAVAHELP] Basic integration

1 reply [Last post]
Anonymous

The application is a Java based. /Per-Arne

-----Original Message-----
From: Discussion list of JavaHelp
[mailto:JAVAHELP-INTEREST@JAVA.SUN.COM]On Behalf Of Roger Brinkley
Sent: Monday, December 01, 2003 7:31 PM
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Basic integration

Per-Arne Ekfeldt wrote:
> Hi Roger, thank you for the input but the application is just for the desktop, not a phone.
> This makes it more simple I hope, can it be done with only using one URL?

Web based or java-client based?

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.

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

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

Per-Arne Ekfeldt wrote:
> The application is a Java based. /Per-Arne
>
If it's java-client based then its relatively easy on your part.

1. Create a HelpSet (helpset file, toc, index, search database, map
file, content). Optionally jar the HelpSet.

2. Include the jh.jar file and the HelpSet (in either jar or unjarred
format) in the CLASSPATH. There are other ways to incorporate the
library and the HelpSet into the application but this is probably the
easiest.

3. In your code find the helpset file and instantiate a helpset object.

URL hsurl = HelpSet.findHelpset("myhelpnamne", null);
HelpSet hs = new HelpSet(hsurl);

4. Create a HelpBroker

HelpBroker hb = hs.createHelpBroker();

5. Create context sensitive help connections

hb.enableHelp(component, id, hs);
hb.enableHelpKey(component, id, hs);
hb.enableHelpOnButton(object, id, hs);

Now you were specifically asking to do something else. You wanted to
have a search performed. The easiest way would be to use the search
navigator in the main window. However, you wanted to control the UI
external of the JavaHelp presentation. To do this you need to mimic what
the search navigator UI is doing. You'll still need a HelpSet so you'll
have to do the first three steps. Next you'll need an ActionListener to
start the search. Still the one from the searchnavigator and prune. For
instance if you're not using a navigatorView you'll have got get the
search engine from the view specified in the Helpset. (See
MergingSearchEngine.makeEngine for details)

class SearchActionListener implements ActionListener {
public synchronized void actionPerformed(ActionEvent e) {
HelpModel helpmodel = searchnav.getModel();
if (helpsearch == null) {
debug("helpsearch is null");
// you'll need to change this.
helpsearch = searchnav.getSearchEngine();
searchquery = helpsearch.createQuery();
searchquery.addSearchListener(BasicSearchNavigatorUI.this);
}
debug("click on search w/: "+searchparams.getText());
if (searchquery.isActive()) {
searchquery.stop();
}
searchquery.start(searchparams.getText(),searchnav.getLocale());
} catch (Exception e2) {
// 2 beeps
searchnav.getToolkit().beep();
searchnav.getToolkit().beep();
}
}
}

Then you need to write a SearchListener to handle the results. Again
see the BasicSearchNavigatorUI.java code for an example of this.

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.