配置

From Apache OpenOffice Wiki
< Zh‎ | Documentation
Revision as of 04:37, 3 June 2008 by Jirong (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



在 OpenOffice.org 中启用 JAVA

OpenOffice.org 使用 Java 虚拟机来实例化用 Java 编写的组件。从 OpenOffice.org 2.0 起,在启动时或最迟在需要 Java 功能时会自动查找 Java。如果您要预先选择 JRE 或 JDK,或未找到 Java,则可以通过 使用 OpenOffice.org 中的工具 – 选项对话框,并选择 OpenOffice.org – Java 部分来配置 Java。在旧版本的 StarSuite 中,您还可以非常容易地告知办公软件使用哪一个 JVM:从 OpenOffice.org 下的程序文件夹启 动 jvmsetup 可执行文件,选择已安装的 JRE 或 JDK,然后单击确定。关闭 OpenOffice.org(包括任务栏 中的快速启动),然后重新启动 OpenOffice.org。另外,打开 OpenOffice.org 中的 工具 – 选项 对话框,然后在 打开的对话框中选择 OpenOffice.org – 安全部分,并确保选中了启可 Java 选项。


使用 Java UNO 类文件和JAVA UNO 运行库文件

Next, the OpenOffice.org API and Java UNO runtime class files must be made known to the Java IDE. For NetBeans the necessary jar files are made available by simply installing the OpenOffice.org API Plugin for NetBeans. After the configuration the plugin installs a new library in NetBeans that can be used in projects directly. The library will be automatically added to new projects created with the project wizards coming with the plugin. The following steps show how to install the plugin in NetBeans 5.5 or higher and how to create a new UNO client application project.

接下来,必须使 Java IDE 识别 OpenOffice.org 类文件和JAVA UNO 运行库文件。使用NetBean IDE的话只需要安装OpenOffice.org API Plugin for NetBeans就可以轻松的创建 UNO 客户端程序项目。对于使用 plugin 新建的 NetBeans 项目,这些 Java UNO jar 文件会自动装入项目中。下列步骤介绍如何在 NetBeans 5.5 或更高版本中创建新UNO客户端应用程序项目以及装入类文件。

  1. 安装并启动NetBeans
  2. 工具菜单中,选择更新中心。在选择要连接的更新中心列表中至少使 NetBeans Update Center 选中, 点击下一步按钮连接更新中心。在 可用更新和新模块 中查找到 OpenOffice.org API Plugin,选中并 添加,点击下一步,接受其协议并按提示完成安装。
  3. A plugin specific configuration dialog comes up and required the input of a PATH to a valid office and SDK installation . After completion of this dialog the plugin is installed and configured correctly.
  4. From the File menu, select New Project. Select OpenOffice.org category and select the OpenOffice.org Client Application. Follow the next step and finish the project wizard.
  5. A new project with your specified name is created. The main function of a generated JAVA skeleton contains already the UNO bootstrap function that gives you access to an office context object as main entry point to get started with the OpenOffice.org API. The context object is from a remote office instance that is connected over a named pipe connection and the default office is started automatically if no instance is running.

Add the API Reference to your IDE

We recommend to add the API and the Java UNO reference to your Java IDE to get online help for the OpenOffice.org API and the Java UNO runtime. The generated reference documentation provides Javadoc conform index files that can be integrated in most Java IDEs. In NetBeans the IDL reference is automatically integrated with the installation of the OpenOffice.org API Plugin.

Using the reference in NetBeans is quite simple, type an IDL type in the editor and press F1. A further useful feature is the code completion feature that you get also automatically when you install the plugin.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools