Guida autonoma

È possibile utilizzare il sistema della Guida di Eclipse anche se si sta creando un'applicazione che non si basa sul framework di Eclipse. L'applicazione può comprimere e installare il sistema autonomo della Guida, una versione molto ridotta di Eclipse che dispone di tutto eccetto che del sistema della Guida che ne è stato estratto. Quindi l'applicazione può effettuare chiamate API dal menu ? o dagli oggetti di interfaccia utente e avviare il browser della Guida. The stand-alone help system has all the features of the integrated help system, except workbench-integrated context help, the help view, and active help. Quando un'applicazione non è basata su Java, oppure se è necessaria la guida quando l'applicazione non è in esecuzione, è possibile utilizzare una guida indipendente da una shell di sistema, uno script shell oppure un collegamento al desktop, e fornire le opzioni della riga comandi invece di richiamare le API Java.

Il sistema di guida indipendente consente di trasmettere le opzioni richieste per personalizzare vari aspetti del sistema della guida. Sono supportate le seguenti opzioni:

Installation/packaging

Questa procedura è destinata all'esperto di integrazione del sistema della Guida e non prevede di ricoprire tutti i possibili scenari. It is assumed that all your documentation is delivered as eclipse plug-ins and, in general, you are familiar with the eclipse help system.
  1. Download the eclipse Platform Runtime Binary driver from eclipse.org.
  2. Installare (decomprimere) il driver nella directory dell'applicazione, ad esempio, d:\myApp. This will create an eclipse sub-directory, d:\myApp\eclipse that contains the code required for the eclipse platform (which includes the help system).

How to call the help classes from Java

  1. Make sure d:\myApp\eclipse\plugins\org.eclipse.help.base_[version].jar is on your classpath, where [version] is the version of the plugin you're using (e.g. org.eclipse.help.base_3.2.0.jar). The class you use to start, launch, and shut down the help system is org.eclipse.help.standalone.Help.
  2. Create an array of String objects containing options that you want to pass to help system support. Typically, the eclipsehome option is needed.
    String[] options = new String[] { "-eclipsehome", "d:\\myApp\\eclipse" };
  3. In your application, create an instance of the Help class by passing in the options. This object should be held onto until the end of your application.
    Help helpSystem = new Help(options);
  4. Per avviare il sistema della Guida:
    helpSystem.start(); 
  5. Per richiamare la Guida all'occorrenza:
    helpSystem.displayHelp(); 

    È inoltre possibile richiamare la Guida relativamente a specifici file del Sommario o argomenti principali:

    helpSystem.displayHelp("/com.mycompany.mytool.doc/toc.xml");
    helpSystem.displayHelp("/com.mycompany.mytool.doc/tasks/task1.htm");
  6. Per avviare la Guida sensibile al contesto richiamare helpSystem.displayContext(contextId, x, y), dove contextId corrisponde a un id contesto completo. Le coordinate dello schermo, x e y,non vengono correntemente utilizzate.
  7. Al termine dell'applicazione, per la chiusura del sistema della Guida:

    helpSystem.shutdown(); 

How to call the help from the command line

The org.eclipse.help.standalone.Help class has a main method you can use to launch stand-alone help from the command line. La sintassi per la riga comandi è:

-command start | shutdown | (displayHelp [href]) [-eclipsehome eclipseInstallPath] [-data instanceArea] [-host helpServerHost] [-port helpServerPort] [-dir rtl] [platform options] [-vmargs JavaVMarguments]

Un modo semplice per visualizzare la guida consiste nel richiamare

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_[version].jar org.eclipse.help.standalone.Help -command displayHelp

from within d:\myApp\eclipse directory, where version is the plug-in's version. To display a specific TOC file or topic use

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_[version].jar org.eclipse.help.standalone.Help -command displayHelp /com.mycompany.mytool.doc/tasks/task1.htm

In questo caso il sistema della guida verrà avviato, effettuerà la visualizzazione e resterà attivo per consentire all'utente di continuare a consultare la guida dopo l'esecuzione del comando. Per controllare la durata dell'esecuzione del sistema di guida, utilizzare i comandi start e shutdown, con il comando displayHelp. Ad esempio, è possibile richiamare

java -classpath d:\myApp\eclipse\plugins\org.eclipse.help.base_[version].jar org.eclipse.help.standalone.Help -command start

[Optional] Installing a minimal stand-alone help system

The stand-alone help does not require the entire eclipse Platform package. It is possible to run the stand-alone help with the RCP Runtime Binary with the following plug-ins added to the eclipse/plugins directory):

org.apache.lucene
org.eclipse.help
org.eclipse.help.appserver
org.eclipse.help.base
org.eclipse.help.ui
org.eclipse.help.webapp
org.eclipse.tomcat
org.eclipse.ui.forms

Note: You must ensure that the following line is present in the eclipse/configuration/config.ini file:

osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runtime@start

Some documentation plug-ins may have dependencies on other plug-ins, usually by specifying required plug-ins in their manifest. The dependent plug-ins need to be installed as well. Additionally, plug-ins that were designed for earlier than 3.0 version of eclipse implicitly require org.eclipse.core.runtime.compatibility plug-in being present to work.

See Product customization for more information on customizing the help system.