Skip to content

When to use WizardPageSupport: probably never (#Eclipse #JFace)

Eclipse RCPJava

Admitted, what Lars Vogel shows in his tutorial looks tempting: Provide neat error messages in Eclipse Wizards using data binding.  But as so often (unfortunately), the code is half-baked, and therefore barely usable.  Data Binding works fine, but Validation, as described, sucks.

In this particular case, WizardPageSupport works well if you have Widgets that can be validated individually: For instance, making sure that an Email field contains emails.  But it breaks down, as soon as the validation takes multiple Widgets into account. Consider an Address field, for instance, where City and Zip Code (and many other fields) have co-dependencies.  Setting the the Zip code should clear the error message on the City, but I have not seen a straight forward way of doing this.

So I dropped WizardPageSupport altogether, and instead added a page-specific validation method to my model.  Then I added a listener to call the validation when anything changes:

public class Page1 extends WizardPage {
public Page1() {
        model.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                IStatus status = model.validatePage1();
                setMessage(status.getMessage(), status.getSeverity());

And ironically, my code got shorter and cleaner, compared to using WizardPageSupport.  Frustrating, as the idea behind this class is neat.

Try this with Windows: Switching to a new laptop by swapping the harddrive works flawless with Linux


I just love the fact that you can just take a hard drive with Linux out of one computer, put it in another one, and it just works.  Try that with Windows! (I tried a few times of the years, always a disaster).

To be fair, Macs seem to be pretty good in migrating from one computer to another, as I have heard.