开发者

Data binding library with support for generics and SWT/JFace?

JFace Databinding doesn't support generics, so it isn't particularly type-safe. And apparently it ne开发者_高级运维ver 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?


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.

Just want to provide clarification. Going forward we are targeting Java 5 and planning to retool the API to use generics.

Stay tuned.

-- Matthew (project committer)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜