Chapter 11. Developing a Plug-in: The Plug-in Development Environment, Manifests, and Extension Points

In this chapter and the next, we’re going to start modifying Eclipse itself. So far, we’ve been using it as we’ve downloaded it, adding a few prebuilt plug-ins as needed. Now we’re going to start creating our own plug-ins. Eclipse was built as an extensible IDE, and we’re going to extend it.

As you know, plug-ins are stored in folders in the plugins directory, and that’s where the ones we create will go. These folders typically have names like org.eclipse.swt.win32_2.1.1 or org.junit_3.8.1, where the folder name is the plug-in name, followed with an underscore and a version number. When Eclipse loads a plug-in that has several folders in the plugins directory, it checks the version number in order to load only the most recent version.

You’ll typically find the following files in every plug-in’s folder:

*.jar

Java code for the plug-in

about.html

Displayed when the user asks for info about the plug-in

plugin.properties

Holds string data used by plugin.xml

plugin.xml

Plug-in manifest that describes the plug-in to Eclipse

lib

Holds additional JAR files

icons

Directory for icons (GIF format is standard)

We’ll see these various files as we develop plug-ins, but we’ll start with the minimum needed. The plugin.xml file is the plug-in manifest, which tells Eclipse about the plug-in. In fact, that’s the only file you really need to create a plug-in as far as Eclipse is concerned.

All You Really Need ...

Get Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.