Monday, June 02, 2008

Pentaho Meetup in Mainz, Germany

1 comments
Pentaho is hosting its first community meetup in Mainz, Germany in a few short weeks. I like the format we've chosen, as it combines informal sessions with lots of food, drink and some touring. And everyone is encouraged to bring their ideas and latest projects for a show and tell.

Find out details and register here. It's sure to be informative and provide an opportunity to make some great Pentaho contacts.

Thursday, May 15, 2008

Creating a Minimum Width Constraint on an SWT SashForm

3 comments
My friend Matt encouraged me to blog a quick snippet of code that many SWT coders might find useful.

If you've used the SWT SashForm, you know it's a nice widget in that it saves you a bit of work that you would do using a traditional Sash. One of the things I expected to get for "free" was the ability to limit how far the sash could expand or collapse a single control, or eseentially constrain the sash from completely hiding any number of it's child controls. To my surprise, I found that this is not a feature of the SashForm.

I have figured out how to create that behavior, by adding a selectionListener to the sash on the sashform. I have to give most of the credit to Duong Nguyen, who posted a partial solution to my problem here.

Without further adue, here's the code:

// Set a minimum width on the sash so that the
// controls on the left are always visible.

// First, find the sash child on the sashform...
Control[] comps = sashform.getChildren();
for (Control comp : comps){

if (comp instanceof Sash){

// My limit is derived from the size of a
// toolbar; yours can be any size you wish ...

int limit = 10;

for (ToolItem item : view.getParent().getItems()){
limit += item.getWidth();
}

final int SASH_LIMIT = limit;
final Sash sash = (Sash)comp;

sash.addSelectionListener (new SelectionAdapter () {
public void widgetSelected (SelectionEvent event) {
Rectangle rect = sash.getParent().getClientArea();
event.x = Math.min (Math.max (event.x, SASH_LIMIT), rect.width - SASH_LIMIT);
if (event.detail != SWT.DRAG) {
sash.setBounds (event.x, event.y, event.width, event.height);
sashform.layout();
}
}
});
}
}

Hope this is useful!
kindest regards,
G

Thursday, March 27, 2008

Kettle, XUL, SWT and a Bit of Theory...

6 comments
I've been working on a very fun and challenging proof of concept / usability project that involves Pentaho Data Integration (Kettle), XUL, SWT, Swing and a very cool, slightly controversial theory: with a lot of work frontloaded, we should be able to port user interfaces to any UI technology, and expect consistent behavior AND look and feel without much, if any, additional code .

The project I'm in the middle of encompasses three different but equally compelling goals:
  1. To move Pentaho forward in providing common layers across our core pillars (reporting , analysis, data mining, ETL and dashboards).
  2. To provide a proof of concept for the Pentaho XUL Framework, an architecture built to help us support common UIs across all of our applications and tools .
  3. To provide a common way of describing and managing the information needed to connect to a database.
So, we began by taking Pentaho Data Integration's connection dialog ( a powerhouse of detail and metadata concerning over 30 different database connection types), applied some usability design to it, and are in the middle of rewriting the dialog using XUL and some new design concepts.

This required a lot of up front work on the part of our lead Pentaho XUL developer, Nick Baker. Nick has plumbed an architecture for Pentaho that makes it possible for us to define a user interface in XML (specifically, using the Mozilla XUL specification), and use a common set of wrapper libraries to render the UI in SWT or Swing, without rewriting any of the UI, and reusing a great amount of the business logic code. There are also plans to begin a XUL-to-Web 2.0 library as well, which will cover most of the UI technologies that we use for the Pentaho projects.

Interested? Download the source and demo, take it for a ride, inspect the code and let me know what you think. Here are the home pages for both the Pentaho XUL Framework project, and the Common Database Connection Dialog proof of concept.

Common Database Connection Dialog

Pentaho XUL Framework Project

Go ahead and post here, on the wiki, or shoot me an email. I look forward to your reactions and suggestions:)

kind regards,
Gretch

PS. All you Kettle users & developers, here's a chance to weigh in on some needed UI changes for Kettle's database UI... don't miss the opportunity!