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. Creating a new implementation language support plugin will require some Java knowledge and the use of other Eclipse plugins.

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

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

Adding a new implementation language support means using two extensions points defined by the org.openoffice.ide.eclipse.core plugin:

The language extension point

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.

Packaging the language plugin

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.

  • Create a build directory

  • Copy the content of the build directory from the java plugin

  • Replace java by your language in all the copied files

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

  • 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.