Adding a new language support

In order to add a new programming language to the ones supported by the OpenOffice.org integration plugin, you will have to develop a small other plugin. This chapter will require some Java skills.

First of all, create a new Eclipse Plugin project using File > New Project and use the following values to fill in the form:

  1. org.openoffice.ide.eclipse.<language>

  2. Plugin ID: org.openoffice.ide.eclipse.<language>

  3. Class name: org.openoffice.ide.eclipse.<language>.<Language>Plugin

In the opened editor, go to the " dependencies" page and add the org.openoffice.ide.eclipse.core plugin to the dependencies. In order to fit the other plugins, rename the src folder into source. In order to have a short directory name, rename you project directory in <language> using your preferred file browser.

Now you are ready to add a new language in your freshly created plugin. Therefore go to the "extensions " page and add a new org.openoffice.ide.eclipse.core.language extension.

Now right click on it and select language to add a language item to configure. Change the name into the language name to print in the plugin dialogs (e.g.: "Java", "C++" or "Python"). Then click on the "class" link to create a new class implementing the ILanguage interface - this class could be named Language. Now you will have to fill in the class methods. You can get some help on each method in the plugin API reference.

There are several ways to package your language plugin. The best one is to integrate it in the global plugin build chain. For this, checkout the other project from the CVS: they are named "core", "java" and "build". Now follow these instructions to make your plugin to be build with the others.

  1. Create a build directory

  2. Copy the content of the build directory from the java plugin

  3. Replace java by your language in all the copied files

  4. Change the version in the build/build.properties file

  5. Add an ant call to your build.xml file in the build project's build.xml file like this:

<ant dir="language/build/" inheritall="false" target="clean" />

Now, you will be able to build all the plugins by running the build project ant file.