Difference between revisions of "Zh/Documentation/DevGuide/FirstSteps/Configuration"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 23: Line 23:
 
# 安装并启动NetBeans
 
# 安装并启动NetBeans
 
# 从'''工具'''菜单中,选择'''更新中心'''。在'''选择要连接的更新中心'''列表中至少使 '''NetBeans Update Center''' 选中, 点击'''下一步'''按钮连接更新中心。在 '''可用更新和新模块''' 中查找到 '''OpenOffice.org API Plugin''',选中并 '''添加''',点击'''下一步''',接受其协议并按提示完成安装。
 
# 从'''工具'''菜单中,选择'''更新中心'''。在'''选择要连接的更新中心'''列表中至少使 '''NetBeans Update Center''' 选中, 点击'''下一步'''按钮连接更新中心。在 '''可用更新和新模块''' 中查找到 '''OpenOffice.org API Plugin''',选中并 '''添加''',点击'''下一步''',接受其协议并按提示完成安装。
# 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.
+
# 与 Plugin 相关的配置对话框会要求你输入合法的 Office 和 Office SDK 的安装路径。配置 完对话框后 Plugin 就安装配置好了。
# 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.
+
# '''文件'''菜单,选折'''新建项目''',从类别中选择 '''OpenOffice.org''',然后选择 '''OpenOffice.org 客户端程序'''。跟随接下来的步骤完成项目向导。
# 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 {{PRODUCTNAME}} 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.
+
# 根据你指定的项目名称将会创建一个新项目。一个包含UNO bootstrap 函数的JAVA主框架程序,UNO bootstrap 函数可以提供让你通过{{PRODUCTNAME}} API 访问Office context 对象的入口。Context 对象是一个通过pipe连接的远程 Office 实例,如果此时没有 Office 实例在运行,那么缺省的 office 会自行启动。
  
 
===Add the API Reference to your IDE===
 
===Add the API Reference to your IDE===

Revision as of 08:12, 3 June 2008



在 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 运行库文件

接下来,必须使 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. 与 Plugin 相关的配置对话框会要求你输入合法的 Office 和 Office SDK 的安装路径。配置 完对话框后 Plugin 就安装配置好了。
  4. 文件菜单,选折新建项目,从类别中选择 OpenOffice.org,然后选择 OpenOffice.org 客户端程序。跟随接下来的步骤完成项目向导。
  5. 根据你指定的项目名称将会创建一个新项目。一个包含UNO bootstrap 函数的JAVA主框架程序,UNO bootstrap 函数可以提供让你通过OpenOffice.org API 访问Office context 对象的入口。Context 对象是一个通过pipe连接的远程 Office 实例,如果此时没有 Office 实例在运行,那么缺省的 office 会自行启动。

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