views:

38

answers:

1

JFace Databinding doesn't support generics, so it isn't particularly type-safe. And apparently it never will, since they wish to preserve Java 1.3 support.

JGoodies supports generics since 2.0.0. Has anyone ported JGoodies 2 to SWT/JFace? Or is there another library which allows both?

A: 

Unfortunately, the JFace binding framework is typeless, which is why I don't use it.

Let's say 'person' is a pojo with a getName() method.

bindingContext.bindValue(SWTObservables.observeText(name, SWT.Modify), PojoObservables.observeValue(person, "name"));

If you change the getName() method, to getEntireName(), the compiler will not catch anything for you - you'll get a runtime exception.

I use a controller between my model and JFace and deal with it that way. I'm not willing to give up the typing.

arcticpenguin