KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > standalone > Infocenter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.standalone;
12
13 import org.eclipse.help.internal.standalone.*;
14
15 /**
16  * This is a standalone infocenter. It takes care of launching the Eclipse with
17  * its help system implementation. This class can be instantiated and used in a
18  * Java program, or can be launched from command line.
19  *
20  * Usage as a Java component:
21  * <ul>
22  * <li>create an instantance of this class</li>
23  * <li>call start(), infocenter will run</li>
24  * <li>when no longer needed call shutdown().</li>
25  * </ul>
26  */

27 public class Infocenter {
28     private StandaloneInfocenter infocenter;
29     /**
30      * Constructs Infocenter
31      *
32      * @param options
33      * array of String options and their values
34      * <p>
35      * Option <code>-eclipseHome dir</code> specifies Eclipse
36      * installation directory. This directory is a parent to
37      * "plugins" directory and eclipse executable. The option must be
38      * provided, when current directory from which infocenter is
39      * launched, is not the same as Eclipse installation directory.
40      * <p>
41      * Option <code>-host helpServerHost</code> specifies host name
42      * of the interface that help server will use. It overrides host
43      * name specified in the application server plugin preferences.
44      * <p>
45      * Option <code>-port helpServerPort</code> specifies port
46      * number that help server will use. It overrides port number
47      * specified in the application server plugin preferences.
48      * <p>
49      * Option <code>-dir rtl</code> sets right-to-left rendering
50      * direction of help UI in the browser.
51      * <p>
52      * Option <code>-noexec</code> indicates that Eclipse
53      * executable should not be used.
54      * <p>
55      * Additionally, most options accepted by Eclipse execuable are
56      * supported.
57      */

58     public Infocenter(String JavaDoc[] options) {
59         infocenter = new StandaloneInfocenter(options);
60     }
61     /**
62      * Starts the stand alone infocenter.
63      */

64     public void start() throws Exception JavaDoc {
65         infocenter.start();
66     }
67     /**
68      * Shuts-down the stand alone infocenter.
69      */

70     public void shutdown() throws Exception JavaDoc {
71         infocenter.shutdown();
72     }
73     /**
74      * Controls start up and shut down of infocenter from command line.
75      *
76      * @param args
77      * array of String containing options Options are:
78      * <code>-command start | shutdown [-eclipsehome eclipseInstallPath] [-host helpServerHost] [-port helpServerPort] [-dir rtl] [-noexec] [platform options] [-vmargs JavaVMarguments]</code>
79      * where
80      * <ul>
81      * <li><code>eclipseInstallPath</code> specifies Eclipse
82      * installation directory; it must be provided, when current
83      * directory is not the same as Eclipse installation directory,
84      * </li>
85      * <li><code>helpServerHost</code> specifies host name of the
86      * interface that help server will use, it overrides host name
87      * specified the application server plugin preferences</li>
88      * <li><code>helpServerPort</code> specifies port number that
89      * help server will use, it overrides port number specified the
90      * application server plugin preferences.</li>
91      * <li><code>-dir rtl</code> sets right-to-left rendering
92      * direction of help UI in the browser.
93      * <li><code>-noexec</code> option indicates that Eclipse
94      * executable should not be used.</li>
95      * <li><code>platform options</code> are other options that
96      * are supported by Eclipse Executable.</li>
97      * <ul>
98      */

99     public static void main(String JavaDoc[] args) {
100         StandaloneInfocenter.main(args);
101     }
102 }
103
Popular Tags