Usage of Validators in SWT Designer

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Usage of Validators in SWT Designer

Postby Marcel Mager » Mon Jun 29, 2009 4:25 am


I have to implement a little validation framework for a business application that should be usable with the SWT Designer.
(Validation results are visualized via ControlDecorations)

Therefore, I would like to use the powerful databinding framework offered by Eclipse.
I encountered several limitations of the Designer's 'Binding' page:

    I would like to enrich the UpdateValueStrategy for my bindings with a configurable Validator. However, only Validators with the default constructor are accepted by the SWT Designer. In my opinion, this is a strong limitation of the databinding framework prohibiting several use-cases.
    Similar to the standard Validators that are used for configuring a Binding, I would like to add MultiValidators to a DataBindingContext for observing cross constraints. However, the only solution I found was to add MultiValidators in the 'Source' page using a $hide block.
    I would like to partition my Bindings. Therefore it would be useful to have multiple DataBindingContext objects each responsible for a part of the bindings. The only way I found was again using $hide blocks.

Did I miss any feature that would be appropriate for me?
Do you have any plans for enriching databinding support?
Marcel Mager
Posts: 2
Joined: Tue Jun 02, 2009 6:26 am

Re: Usage of Validators in SWT Designer

Postby Eric Clayberg » Fri Jul 03, 2009 10:01 am

Marcel Mager wrote:Did I miss any feature that would be appropriate for me?

Not that I can see.

Note that the initDataBindings() method is read and written as a unit, so you should not make any direct changes to it unless you are following the exact pattern it generates. You can access the bindingContext outside of that method, and you can assign individual bindings to fields which can also be accessed outside of that method. That should allow you take advantage of some of the more esoteric aspects of the Data Binding API

Marcel Mager wrote:Do you have any plans for enriching databinding support?

We have been constantly "enriching" or Data Binding support...most recently with support for EMF and the Eclipse 3.5 DB API.

We do not currently have plans to add support for the three things that you mention, but we will keep them in mind for possible future enhancements. The main problem with all of them is that they would add a great deal of complexity to the Bindings page and other elements of our DB support while providing modest additional value to most of our users.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests