If you are creating an application that is not based on the Eclipse framework, you can still use the Eclipse help system. Your application can package and install the stand-alone help system, a very small version of Eclipse that has everything except the help system stripped out of it. Then, your application can make API calls from its Help menu, or from UI objects, to launch the help browser. The stand-alone help system has all the features of the integrated help system, except infopops and active help. When an application is not Java based, or help is required when the application is not running, it is possible to use stand-alone help from a system shell, a shell script or a desktop shortcut and provide command line options instead of calling Java APIs.
The stand-alone help system allows passing number of options that can be used to customize various aspects of the help system. The following options are supported:
-nl fr_FR
will start help system in French language instead of a language specified by the machine's locale.String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" };
Help helpSystem = new Help(options);
helpSystem.start();
helpSystem.displayHelp();
You can also call help on specific primary TOC files or topics:
helpSystem.displayHelp("/com.mycompany.mytool.doc/toc.xml"); helpSystem.displayHelp("/com.mycompany.mytool.doc/tasks/task1.htm");
At the end of your application, to shutdown the help system:
helpSystem.shutdown();
The org.eclipse.help.standalone.Help class has a main method that you can use to launch stand-alone help from a command line. The command line arguments syntax is:
-command start | shutdown | (displayHelp [href]) [-eclipsehome eclipseInstallPath] [-host helpServerHost] [-port helpServerPort] [-servertimeout timeout] [platform options] [-vmargs JavaVMarguments]
A simple way to display help is to invoke
java -classpath d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar org.eclipse.help.standalone.Help -command displayHelp
from within d:\myApp\eclipse directory. To display specific TOC file or topic use
java -classpath d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar org.eclipse.help.standalone.Help -command displayHelp /com.mycompany.mytool.doc/tasks/task1.htm
The calls above to display help will cause help system to start, display help, and keep running to allow a user to continue browsing help after the command is executed. To control the life cycle of the help system, use start and shutdown commands, in addition to the displayHelp command. For example, you may call
java -classpath d:\myApp\eclipse\plugins\org.eclipse.help_2.1.0\help.jar org.eclipse.help.standalone.Help -command start
The stand-alone help does not require the entire Eclipse Platform package.
It is possible to run the stand-alone help with the following plug-ins (located
in the eclipse\plugins directory):
org.apache.lucene
org.apache.xerces
org.eclipse.core.boot
org.eclipse.core.resources
org.eclipse.core.runtime
org.eclipse.help
org.eclipse.help.appserver
org.eclipse.help.webapp
org.eclipse.tomcat
org.eclipse.update.core
In addition to these plugins, depending on the operating system or machine
architecture, you may need to also need to install the corresponding fragments
for the above plugins (when they exist). For example, on Windows, you need
to add the following fragments (also located in the eclipse\plugins directory):
org.eclipse.core.resources.win32
org.eclipse.update.core.win32
On Windows, it is possible to provide a different help browser (an SWT-embedded Internet Explorer web browser) by adding the following plugins and fragments on top of the minimal configuration:
org.eclipse.help.ui.win32
org.eclipse.help.ui
org.eclipse.jface.text
org.eclipse.jface
org.eclipse.search
org.eclipse.swt.win32
org.eclipse.swt
org.eclipse.text
org.eclipse.ui.editors
org.eclipse.ui.views
org.eclipse.ui.win32_2.1.0
org.eclipse.ui.workbench.texteditor
org.eclipse.ui.workbench
org.eclipse.ui