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.
Copyright © 2008 The Eclipse Foundation.June 24, 2008
Thursday, June 26, 2008
Decoupling with Adapters - The Adapter pattern
Interesting article that demonstrate Adapter pattern and its usage in Eclipse.
Sunday, June 22, 2008
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());
}
});
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.
Amazing?
Informative screencasts show just how easy it is to build an application in Grails.
Friday, June 13, 2008
Build an Ajax application using Google Web Toolkit, Apache Derby, and Eclipse
A four parts article from developerWorks
Part 1: The fancy front end
Part 2: The reliable back end
Part 3: Communication
Part 4: Deployment
Part 1: The fancy front end
Part 2: The reliable back end
Part 3: Communication
Part 4: Deployment
Firefox 3 is coming, June 17
After more than 34 months of active development FF3 is ready to be released
Subscribe to:
Comments (Atom)