Jump-start Eclipse plug-ins -I - Making your first plugin
Recently, a friend of mine approached me with an interesting query. He told me all about the different IDEs he'd seen that were made on top of the Eclipse Platform like Flex Builder and RAD etc. and he was curious to learn how to start - rather jump start with plugin development. I suggested that he read "Contributing to Eclipse" (Gamma et al.) and "Eclipse for the Java Developer".The following day, I got a phone call from him. He told me that he ha'd given up on that as he thought that the learning curve is too steep. That was surpising, to hear from an experienced Java developer. Upon discussing the matter with other java developers whom I knew, I was surprised to hear them echoing the same sentiment. Now, when I look at it from an unbiased newbie's standpoint, I feel that they were probably right.
An absolute newbie to eclipse development would be bewildered! And if you are impatient, it would be all the more worse. In trying to build Rome in a day, all you would get is another set of acronyms to add to the long list that you already know as a Java developer like SWT, JFace, RCP etc. But the fact is that for the impatient newbie, there isn't an "Eclipse plug-in development in 24 hours". I hope this short introduction jump-starts you into eclipse plugin development.
Without further ado, lets dive right in. Open Eclipse and then create a new Plugin Project. I'll tell you how.
1. Select File>New>Project
2. Select Plug-in Development

Ok, now onto the next screen by clicking "Next".
3. Give a name for your project. We are going to make a HTML editor here. So I have named my project as "HTMLEditor".

Onward to the next screen...
4. Type in other facny stuff.. like the provider for the plug in..

5. From the "Templates" screen, choose "Plug-in with an editor".


The white box right at the bottom is the PlatForm Runtime and the rest are all plug-ins built on top of it. Each plugins carries with it a set of packages and each plug-in extends from Extension Points of the plug-ins which are used to build it. Imagine it like a piece of a jigsaw - it has holes to fit in other pieces and it also has projections which perfectly fit into fissures of the same shape in the adjacent piece. The holes are the extension points of the plug-in which can be used to fit other plug-ins on top. And the projection fits into another already existing hole - that hole is the extension point of some already existing plug-in which was used by our plug-in. So our editor plug-in uses the extension points of the org.eclipse.ui.editors plugin and extends from it. Okay, onto the final screen now.
6. Fill in other details.

Now that we have some key concepts in the bag. Let's take a breather now. I'll see you in the next part for adding more features into it.
No comments:
Post a Comment