Thursday, June 26, 2008

Decoupling with Adapters - The Adapter pattern

Interesting article that demonstrate Adapter pattern and its usage in Eclipse.

Summary

The adapter pattern is used extensively in Eclipse. The use of this pattern allows plug-ins to be loosely coupled, yet still be tightly integrated in the extremely dynamic Eclipse runtime environment. In this article, we show you how to use the adapter framework to make your own objects adaptable, and adapt other objects.

By Wayne Beaton, The Eclipse Foundation
June 24, 2008

Sunday, June 22, 2008

GWT Drag and Drop support

Library providing easy to use drag-and-drop capabilities to Google Web Toolkit (GWT) projects

http://code.google.com/p/gwt-dnd/

Gradient Background to any SWT Control

Helper class that add gradent bg to a give control

public class GradientHelper{

private static Image oldImage = null;

public static void applyGradientBG(
Composite composite) {
Rectangle rect = composite.getClientArea();
Image newImage = new Image(composite.getDisplay(), 1, Math.max(1,
rect.height));
GC gc = new GC(newImage);
gc
.setForeground(composite.getDisplay().getSystemColor(
SWT.COLOR_WHITE));
gc.setBackground(new Color(composite.getDisplay(), 228, 234, 243));
gc.fillGradientRectangle(0, 0, 1, rect.height, true);
gc.dispose();
composite.setBackgroundImage(newImage);

if (oldImage != null)
oldImage.dispose();
oldImage = newImage;
}
}


Examples

Adding background to a tree.

treeView.getTree().
addListener(SWT.Resize,new Listener() {
public void handleEvent(Event event) {
GradientHelper.applyGradientBG(rreeViewer.getTree());
}
});

Adding some magic 2.0

Magic tools for web sites

Tuesday, June 17, 2008

Grails !!! Screencast is amazing

Database driven web application based on java, hibernate, spring in 3 mins. UI included!!!


Amazing?

Informative screencasts show just how easy it is to build an application in Grails.