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

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: {{Documentation/DevGuide/FirstStepsTOC/Zh |FirstSteps2a=block |ShowPrevNext=block |PrevPage=Zh/Documentation/DevGuide/FirstSteps/Installation Sets |NextPage=Zh/Documentation/DevGuide/First...)
 
m
 
(8 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
|NextPage=Zh/Documentation/DevGuide/FirstSteps/First Contact
 
|NextPage=Zh/Documentation/DevGuide/FirstSteps/First Contact
 
}}
 
}}
 +
{{Documentation/DevGuideLanguages|Documentation/DevGuide/FirstSteps/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:配置}}
 
{{DISPLAYTITLE:配置}}
 
===在 {{PRODUCTNAME}} 中启用 JAVA===
 
===在 {{PRODUCTNAME}} 中启用 JAVA===
Line 10: Line 11:
 
{{PRODUCTNAME}} 使用 Java 虚拟机来实例化用 Java 编写的组件。从 {{PRODUCTNAME}} {{OOo2.x}} 起,在启动时或最迟在需要 Java 功能时会自动查找 Java。如果您要预先选择 JRE 或 JDK,或未找到 Java,则可以通过
 
{{PRODUCTNAME}} 使用 Java 虚拟机来实例化用 Java 编写的组件。从 {{PRODUCTNAME}} {{OOo2.x}} 起,在启动时或最迟在需要 Java 功能时会自动查找 Java。如果您要预先选择 JRE 或 JDK,或未找到 Java,则可以通过
 
使用 {{PRODUCTNAME}} 中的'''工具 – 选项'''对话框,并选择 '''{{PRODUCTNAME}} – Java''' 部分来配置 Java。在旧版本的
 
使用 {{PRODUCTNAME}} 中的'''工具 – 选项'''对话框,并选择 '''{{PRODUCTNAME}} – Java''' 部分来配置 Java。在旧版本的
StarSuite 中,您还可以非常容易地告知办公软件使用哪一个 JVM:从 {{PRODUCTNAME}} 下的程序文件夹启
+
{{PRODUCTNAME}} 中,您还可以非常容易地告知办公软件使用哪一个 JVM:从 {{PRODUCTNAME}} 下的程序文件夹启
 
动 jvmsetup 可执行文件,选择已安装的 JRE 或 JDK,然后单击确定。关闭 {{PRODUCTNAME}}(包括任务栏
 
动 jvmsetup 可执行文件,选择已安装的 JRE 或 JDK,然后单击确定。关闭 {{PRODUCTNAME}}(包括任务栏
 
中的快速启动),然后重新启动 {{PRODUCTNAME}}。另外,打开 {{PRODUCTNAME}} 中的 '''工具 – 选项''' 对话框,然后在
 
中的快速启动),然后重新启动 {{PRODUCTNAME}}。另外,打开 {{PRODUCTNAME}} 中的 '''工具 – 选项''' 对话框,然后在
 
打开的对话框中选择 '''{{PRODUCTNAME}} – 安全'''部分,并确保选中了启可 Java 选项。
 
打开的对话框中选择 '''{{PRODUCTNAME}} – 安全'''部分,并确保选中了启可 Java 选项。
 
 
  
 
===使用 Java UNO 类文件和JAVA UNO 运行库文件===
 
===使用 Java UNO 类文件和JAVA UNO 运行库文件===
 
Next, the {{PRODUCTNAME}} 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 [http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration 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 识别 {{PRODUCTNAME}} 类文件和JAVA UNO 运行库文件。使用NetBean IDE的话只需要安装[http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration OpenOffice.org API Plugin for NetBeans]就可以轻松的创建 UNO 客户端程序项目。对于使用 plugin 新建的 NetBeans 项目,这些 Java UNO jar 文件会自动装入项目中。下列步骤介绍如何在 NetBeans 5.5 或更高版本中创建新UNO客户端应用程序项目以及装入类文件。
 
接下来,必须使 Java IDE 识别 {{PRODUCTNAME}} 类文件和JAVA UNO 运行库文件。使用NetBean IDE的话只需要安装[http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration OpenOffice.org API Plugin for NetBeans]就可以轻松的创建 UNO 客户端程序项目。对于使用 plugin 新建的 NetBeans 项目,这些 Java UNO jar 文件会自动装入项目中。下列步骤介绍如何在 NetBeans 5.5 或更高版本中创建新UNO客户端应用程序项目以及装入类文件。
Line 25: Line 22:
 
# 安装并启动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===
 
  
We recommend to add the API and the Java UNO reference to your Java IDE to get online help for the {{PRODUCTNAME}} 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 [http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration 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.
+
===将 API 引用添加到 IDE 中===
 +
 
 +
建议将 API 引用和 Java UNO 引用添加到 Java IDE,以获得 {{PRODUCTNAME}} API 和 Java UNO 运行时的联机帮助。The generated reference documentation provides Javadoc conform index files that can be integrated in most Java IDEs. 在 NetBeans IDE 中, IDL 引用会在[http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration OpenOffice.org API Plugin] 安装时自动与系统配置集成。
 +
 
 +
在 NetBeans IDE 中浏览API 引用非常轻松, 在编辑器中输入一个 IDL 类型 (或将光标置于 {{PRODUCTNAME}} API 和 JAVA UNO 标识符上),使用'''Alt + F1'''组合键来查看联机帮助。另一个有用的功能既是代码完成功能。
  
 
{{PDL1}}
 
{{PDL1}}
  
[[Category:Documentation/Developers Guide/First Steps]]
+
 
 +
[[Category:文档/开发者指南/准备工作]]

Latest revision as of 01:44, 14 May 2009



在 OpenOffice.org 中启用 JAVA

OpenOffice.org 使用 Java 虚拟机来实例化用 Java 编写的组件。从 OpenOffice.org 2.0 起,在启动时或最迟在需要 Java 功能时会自动查找 Java。如果您要预先选择 JRE 或 JDK,或未找到 Java,则可以通过 使用 OpenOffice.org 中的工具 – 选项对话框,并选择 OpenOffice.org – Java 部分来配置 Java。在旧版本的 OpenOffice.org 中,您还可以非常容易地告知办公软件使用哪一个 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 会自行启动。


将 API 引用添加到 IDE 中

建议将 API 引用和 Java UNO 引用添加到 Java IDE,以获得 OpenOffice.org API 和 Java UNO 运行时的联机帮助。The generated reference documentation provides Javadoc conform index files that can be integrated in most Java IDEs. 在 NetBeans IDE 中, IDL 引用会在OpenOffice.org API Plugin 安装时自动与系统配置集成。

在 NetBeans IDE 中浏览API 引用非常轻松, 在编辑器中输入一个 IDL 类型 (或将光标置于 OpenOffice.org API 和 JAVA UNO 标识符上),使用Alt + F1组合键来查看联机帮助。另一个有用的功能既是代码完成功能。

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