Implement the SampleHandler which is the default handler for the command. The handler should implement the interface IHandler or can simply extend AbstractHandler. Now we can add the Command to application main menubar, toolbar or to a menubar and toolbar of a view.

Sunday, January 18, 2009

Rich Ajax Platform, a web development platform for RCP Developers. RAP uses the whole plugin architecture of the eclipse platform and provides a SWT port called RWT for the web browsers. RWT uses the qooxdoo java script library to create the User interfaces on the browser side.

Singleton

Singleton pattern is something which is widely used on the eclipse platform. But for a web based application where multiple users will be accessing the application we need session based singleton implementation.

SessionSingletonBase

Eclipse RAP provides a base class called SessionSingletonBase which provides a singleton implementation for each session and avoids the sharing the application state between the users.

so just extends the SessionSingletonBase and create a singleton instance as done below.

Friday, January 16, 2009

Continuous integration is a practive where developers integrate their work frequently. This help the team increase their productivity by detecting the integrating errors as early as possible during the development. There are a lot of build tools which helps in automating the build process with different reports which helps the developers to increase their work productivity.

Ant, Maven

Ant and Maven are two build tools which are very widely used in the java build process. Though ANT is a old and little complicated tool than the Maven, it gives the flexibility to do the build for any kind of software application.Maven works great for almost all kinds of java application like web application, desktop applications. Maven also generates a whole lot of reports which helps the team at various levels to see the progress of the development.

Building Eclipse Products

Building eclipse product is always a difficult job if you want to do it outside the Eclipse Environment. And especially building eclipse product with maven not so easy work. Though there are existing plugins which does the product build little easier, they are not as efficient as the ANT counter part.

Since eclipse requires its own run time environment for building and running, the Maven structure does not help a lot. The following maven plugins does help in building eclipse plugins

But running the test cases and generating different reports based on this is a difficult process using the above tools.

Combining ANT and Maven

PluginBuilder is a eclipse plugin which provides an easy mechanism to create the ANT build scripts for building eclipse plugins, running test cases, and building the product. And it works out of the box.

Download it from http://www.pluginbuilder.org/

Create your plugin project with the test cases in a separate fragment project.

Create the build.xml and other supporting files for the ANT Build which creates Product, Test Report and Test Coverage Report.

Configure a ANT build step on the Automated build tool such as Luntbuild.

Now for the usual Maven reports and site generation we can use the Maven PDE plugin without the test option. This should not include the test fragments in build path.

This is it. You get a Product file, Unit Test Reports, Unit Test Coverage and all maven reports deployed as a site.

This tutorial doesnt give you step by step procedure but if you need help doing anything above. Just drop in a comment.

On eclipse based applications, there is a way to display the heap status on the status bar. The API which enables this feature is internal and the way to make it to visible is to create the plugin customization file.

Add the following property in the plugin.xml under the products extension

And on the plugin_customization.ini

org.eclipse.ui/SHOW_MEMORY_MONITOR=true

The SHOW_MEMORY_MONITOR parameter will be looked when the workbench is created and if it is true it will create the heap status bar.

Thursday, January 15, 2009

Sometimes you may need to create a file in the runtime workspace temporarily or to store application wide data. This is better than storing the file inside the .metadata/.plugins/ folder since this will require having to have a dependency on plugin which is creating the file.