Extending With Plug-ins

Its possible to extend the functionality of IBM Rational Developer for Power Systems Software by leveraging the eclipse plug-in framework to write your own plug-ins.

One common case where it may be advantageous to write your own plug-in is if you are using a custom build tool or compiler other than the default ones that are supported out-of-the-box. In this case you can write your own error-parser plug-in to better integrate with your build tool.

The job of an error-parser is to recognize warnings, errors and other important messages in the compiler or build tool output and create "problem marker" objects for them. Problem markers are displayed as an error or warning icon in the Project Explorer and Problems views as well as the editor.

Problem markers generated by an error-parser

The first step is to set up an environment for writing plug-ins. Once this is done please continue on to the section on how to write an error-parser plug-in.


Install an Eclipse instance with support for Java and Plug-In development

IBM Rational Developer for Power Systems Software does not ship with the components necessary to develop eclipse plug-ins. The first step is to download and install an eclipse distribution that does have this ability. Go to www.eclipse.org/downloads and download the "Eclipse Classic" distribution. This should include the eclipse platform, the Java Development Tools (JDT) and the Plug-In Development Environment (PDE).

To install Eclipse all that is needed is to unpack the downloaded zip file in a location of your choosing. No further work is required (other than making sure you have a Java Runtime Engine installed). When you unzip the file, it creates a directory called "eclipse". For example in Windows you could unpack the zip file in the root directory (e.g., C:\) and Eclipse would be installed in C:\eclipse.

Since Eclipse is a Java program, you will need to have Java installed to run Eclipse. Eclipse can run on a number of Java Virtual Machines. Eclipse officially recommends Java version 5 (also known as 1.5), although many Eclipse users use the newer version 6 (1.6).

To run eclipse simply execute the "eclipse" executable in the eclipse root directory. For example on Windows simply run the eclipse.exe file. If you run into difficulties installing or running eclipse please visit the following links for more information:
FAQ: Where do I get and install Eclipse?
FAQ: I unzipped Eclipse but it won't start
FAQ: Known Issues

Eclipse comes with extensive help documentation, including complete documentation on how to use eclipse for Java development. Select Help > Help Contents from the menu to activate the eclipse help system. There will be a category named Java development user guide which contains documentation on how to use eclipse for Java development.


Set the target platform

In order to create new plug-ins for your installed copy of IBM Rational Developer for Power Systems Software you will need to configure eclipse to use it as the Target Platform. To do this start by opening the global preferences (Window > Preferences) then navigate to the Target Platform preference page (Plug-in Development > Target Platform).

Start by creating a new target definition. Click the Add button to open the New Target Definition dialog.

New Target Definition dialog

Select the Nothing option to create a new empty target definition and click Next. Give the target definition a name. Under the Locations tab click the Add button, this will open the Add Content dialog.

Add Content dialog - page 1

Select Installation as the source of plug-ins and click Next.

Click the Browse button and navigate to the folder where IBM Rational Developer for Power Systems Software is installed. Select the SDP directory then click Finish. Then repeat this process one more time to add the SDPShared directory as well.

Add Content dialog - page 2

Your target definition should look similar to the following:

New Target Definition dialog

Finally set the new target definition as active and click Finish.

Target Platform Preferences Page


Create a run configuration

You will need to be able to launch IBM Rational Developer for Power Systems Software from inside eclipse in order to test and debug the plug-ins that you write. This is done by creating a Run Configuration. Open the Run Configurations dialog (Run > Run Configurations).

Double-click on Eclipse Application, this will create a new run configuration. If you have configured your target platform correctly then the new run configuration should be initialized with the correct defaults.

Run Configuration Dialog

Make sure that com.ibm.rational.rdaix.product.ide is selected under the Main tab in the Program To Run section.

Click the Run button at the bottom of the dialog to launch IBM Rational Developer for Power Systems Software. A new instance of will be launched and it will be connected to a new workspace, you should see an empty workspace with no projects.

Optional: It is possible to reuse an existing workspace if you like. Simply change the workspace location field under the Main tab in the Run Configurations dialog to point at an existing workspace. Note that you cannot run two IBM Rational Developer for Power Systems Software instances at the same time with the same workspace. If you are currently viewing this help document from inside a running instance and you try to launch another instance on the same workspace you will get an error dialog saying that the workspace is locked. You may have to print this help document and shut down the currently running instance.

The newly created run configuration can also be used to debug the plug-ins that you write. Select Help > Help Contents from the menu to activate the eclipse help system. There will be a category named Java development user guide which contains documentation on how to use the Java debugger.


Start writing your plug-in

If all you would like to do is write an error-parser plug-in then please continue to the section on how to write an error-parser plug-in.

If you intend to write more interesting plug-ins that do advanced things then you will need a deeper understanding of eclipse plug-in development. The eclipse instance that you have installed will contain documentation on how to write eclipse plug-ins. Select Help > Help Contents from the menu to open the eclipse help system. The category named Platform Plug-in Developer Guide contains documentation on how to write eclipse plug-ins. There is also detailed documentation available on eclipse.org.

Next: How to write an error-parser plug-in.