Archive

Archive for September, 2010

Understanding basic concepts in eclipse

September 22, 2010 1 comment

In my earlier post i have introduced you to eclipse.Now, before we start using eclipse api’s we need to understand some very basic key concepts in eclipse architecture.In this post i am going to have a walk through of the basic key concepts in eclipse plugin architecture.

Plugin:

The first and the most basic thing of eclipse is nothing but a plugin. A plugin is nothing but  an individual runnable component  which may be plugged into or may  have pluggable components for another runnable component to get plugged in for running it.For more detailed reference you can refer here.

A simple plugin.xml will look as shown below.

In the above shown plugin.xml , it defines a perspective and a view which are there in the plugin. You can notice here that the terms extension point and extension is mentioned in the file. The next thing we are going to see is about extension and extension points.

Extension & Extension Points:

The next basic things in eclipse are nothing but extension and extension points.

An extension is nothing but a pluggable component defined in a plugin.In real life scenario you can imagine an extension as a memory card. So to read a memory card you need a card reader, right?

the card reader slot is nothing but the extension point. An extension point defines some rules (as there in real life scenarios) for it and whichever extensions which are having compliance to those rules can be plugged in to it. Extension and extension points is the basic way of how pulgins are interacting between each other. So you can understand from here that the “extensions” have the functionality written in them, if any other plugin wants to use the similar functionality it can be plugged into it and can be used.

In the above plugin.xml shown it uses two extensions

1)  org.eclipse.ui.perspectives

2)  org.eclipse.ui.views

LifeCycle of a plugin:

The Life cycle of a plugin is controlled by a class called “Activator.java” which will be created by eclipse itself when a plugin is created. A sample activator class will look look this.

The start method is called whenever the plugin is getting loaded.

When does a plugin gets started?

Eclipse by default follows lazy loading concept, i.e a plugin will be loaded only if one of its class is getting called. We can override this lazy loading option also so that the plugin gets loaded whenever your application is loaded.

There are three scenarios a plugin will be activated.

  • If your plugin has an executable extension, and if another plugin is using/running  it, that time your  plugin will be automatically loaded.
  • If your  plugin exports any of its libraries (JAR files),  another plugin can reference and instantiate your plugin  classes directly. Loading a class belonging to your plugin causes it to be started automatically.
  • A plugin can be activated explicitly, using the API method Platform.getPlugin(). This method returns a fully initialized plugin instance.

For more details please refer here.

Advertisements
Categories: eclipse rcp

Eclipse! – A Perfect pick for developing stand alone tool

September 12, 2010 Leave a comment

Today in the world of software two major things are acting as the interface to the end user. First and the major(nowadays)  are the web applications(eg: Indian railway online booking) and the next thing is the stand alone tools(eg: MS Word,vlc media player) both of them have their own specific purpose  in their space. Here in this post i am going to talk about a beautiful ,a very popular editor and very well designed technology which helps any developer to develop and deliver a stand alone tool.If u have any guesses the answer here is nothing but Eclipse.

Eclipse has many advantages , to mention a few it is open source , the large community behind it developing such a kind of tool , it’s support for developers by having a good and neatly maintained documentation  and also  it’s powerful design.

The basic functional part of eclipse is called plug-in. In my own definition you can understand a plug-in as an individual runnable application/module  which may be plugged into or will accept another runnable application/module to run.The biggest advantage of eclipse is its plug-in architecture.It beautifully separates out the individual  responsibilities of different modules in an application.To see the definition of eclipse plug-in given by eclipse community refer here.

In my forthcoming posts i am going to write about how we are going to use the power of eclipse to develop a stand alone tool.

Categories: eclipse rcp

Hello world!

September 11, 2010 1 comment

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Categories: Uncategorized