Create and configure a project |
- Make sure that you have configured a valid OpenOffice.org and OpenOffice.org SDK installation
under Tools > Options > Miscellaneous > OpenOffice.org Extensions
- Use the OpenOffice.org Add-On project template.
Choose File > New Project > OpenOffice.org > OpenOffice.org Add-On.
- Specify the project name.
- Specify the main class name. The main class name is used to create a Java class.
- Specify a Java package (implicitly used, together with the main class name, to create a protocol belonging to your Add-On).
- Select the project location. The project location is the directory where the new project should be created.
- Choose if you want to create an entry in the Menu structure or a Toolbar. Either one, or both of those must be selected.
- Define the commands, and add localization and icons to represent the commands.
- Define submenus or separators, and structure the commands. The same structure that is defined here will be created in the OpenOffice.org menu bar.
Select the context where your commands should be visible.
- Define the toolbar with separators, and structure the commands. The same structure that is defined here will be created OpenOffice.org as new toolbar.
Select the context where your commands should be visible.
- Finish the wizard to generate all necessary files and the initial
code skeleton for the new Add-On.
- Open the generated Java file with the class name and implement actions
for the commands the Add-On will react on.
-
Configure the classpath for the project. You can add a JAR file, a
library, or
an IDE project to the classpath.
|
|
Build the project
|
- Choose Build >
Build Main Project or right-click any project and choose Build Project.
- With the context menu of the project node (projects window) you can create and deploy an office
extension package directly in your specified office installation.
Right click on the project node > Create OXT to create the extension package.
Right click on the project node > Deploy Office Extension to deploy the extension.
- Alternatively, you can chose the appropriate targets in the context menu for the build.xml file.
Choose build.xml > Run Target > uno-package to create the extension package.
Choose build.xml > Run Target > uno-deploy to deploy the extension.
|
|
Run the project |
- This is currently not supported. OpenOffice.org extensions are running in the OpenOffice.org process and a suitable workflow
to support this from inside the IDE is currently not yet implemented.
|
|
Debug the project |
- Debugging OpenOffice.org extensions is quite simple. In the Projects window, open the context
menu and select "Debug Extension in Target Office".
- OpenOffice.org is started with a new user installation that is created in the
build/soffice_debug directory. Your extension is deployed in this new user installation
and OpenOffice.org is started.
- Set breakpoints or
watches in your code.
- Use your Add-In in OpenOffice.org so that your code is executed.
- The code execution will stop at your breakpoint.
|