A First Look at Eclipse Plug-In Programming
"First they ignore you, then they laugh at you, then they fight you, then you win."—Mahatma Gandhi (1869-1948)
1.1. What is Eclipse?
The Java platform is extensively used on server and enterprise applications. Java is even used on systems that require high performance. Despite its extensive use on server platforms, it has not been used too much on desktop applications. The main reason is the look & feel of the Java applications. Most end-users find Java look & feel differently then the one what they are accustomed to. After the introduction of Swing, there were many new things that a programmer can control and use.
On the other hand, platform-dependent integration was still missing. It was still hard to use MSOffice tools with Swing.
Eclipse solves the problems that exist in the current Swing library. The SWT library provides a platform-dependent look & feel. In addition to that, Eclipse provides a plug-in based framework that can be used as a base platform for desktop applications.
1.1.2. Who is behind Eclipse?
IBM has started to develop a project called Eclipse. IBM invested 40 K dollars before giving it away to the open source community. The first release of Eclipse V 1.0 wass announced in November 2001. Eclipse is supported by many other organizations such as Borland Software Corp., Merant Internation Ltd., Oracle, Rational Software Corp., Red Hat Inc., SuSe Inc., and TogetherSoft Corp.
1.1.3. What makes Eclipse unique?
Eclipse is a set of frameworks that brings Java applications to the desktop. In contrast to many other open source projects, Eclipse is supported by many big companies.
SWT (The Standard Widget Toolkit) library delivers native widget functionality for the Eclipse platform in an operating system-independent manner. The SWT library can be used to provide native look and feel to the end-users. End-users don't know whether the application is a Java application or a native application.
The Eclipse platform delivers plug-in–based architecture. Everything except a small bootstrap code is written as a plug-in in Eclipse. The Eclipse platform architecture includes all the GUI design patterns. For example, it provides plug-in versioning, a help system, and so forth. It can also be used as general purpose IDE architecture. Eclipse Java IDE is based on generic plug-in architecture, which makes it easy to support other languages as well.
Through its predefined infrastructure, different vendor plug-ins can communicate with each other easily.
1.2. Where to start?
Eclipse has its own GUI library (SWT) that provides a native look and feel for Eclipse. Eclipse code is written in Java that calls the SWT library through JNI. Eclipse does not ship with a JVM. To use Eclipse, a JVM must exist on the target platform. Otherwise, you will get the following error message.
Figure 1. Error message shown when there is no JVM installed.
To develop under Java, it is better to download and install a JDK.
Eclipse can be found on the Eclipse download Web site at no charge. I would suggest you download the latest release build (Build name: 2.1.2) of the "Eclipse SDK" from the main Eclipse download site.
Eclipse workbench uses the native SWT library. Therefore, appropriate target platform download should be selected for the download. The SWT library supports the following platforms:
|Table 1. SWT Platforms|
|Operating System||Windowing Sub-system|
After downloading and unzipping the Eclipse zip file it should be started by running the Eclipse executable file found under the top-level installation directory.
|Changing the workspace location|
|You can specify different workspace locations by using eclipse.exe -data <location> as a command line parameter of the Eclipse executable.|
The default location of the workspace is the root installation directory of the Eclipse installation. If you want to run different instances of Eclipse for different projects or purposes, you can do the following:
1.3. Projects under eclipse.org
There are different projects developed under eclipse.org. The picture below shows these projects.
Figure 2. The Eclipse.org project structure
Eclipse project provides industry-standard, commercial-quality integrated tools. The Eclipse project consists of three sub projects. These are:
- Platform (core—plug-in based architecture)
- JDT (Java Development Tools)
- PDE (Plug-in Development Environment)
Eclipse JDT is very good tool at no cost. It provides much functionality, such as syntax highlight, code refactoring, debugger, team environment, and scrapbook.
PDE provides the tools to write plug-ins. PDE makes it easy to write a plug-in within a plug-in environment. You can write a plug-in easily. PDE runs your plug-in within another Eclipse instance. It also allows you to select the plug-in to be included in your application.
Eclipse tools project provides a central place for tool builder for the Eclipse platform.
Eclipse technology project provides new channels for open source developers, researchers, academics, and educators to participate in the on-going evolution of Eclipse.
"Eclipse officials said that the new organization will work and look a lot like the Apache Foundation and that members will have to commit to provide a commercial product that supports Eclipse within 12 months of joining."