java Swing 数据绑定框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2400998/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 20:58:00  来源:igfitidea点击:

Swing data binding frameworks

javaswingdata-binding

提问by Ahe

Almost the same question has been asked a year ago, but the there has been some new development in this area.

几乎在一年前就有人问过同样的问题,但是在这方面有了一些新的发展。

Selecting a (data binding) framework for swing application seems to be quite difficult. JSR-295 is abandoned, many swing frameworks which provide binding are work-in-progress, abandoned or too heavy for my quite simple app. JGoodies Swing suite is expensive, but luckily its libraries are free.

为 Swing 应用程序选择一个(数据绑定)框架似乎相当困难。JSR-295 已被废弃,许多提供绑定的 Swing 框架仍在开发中、已废弃或对于我非常简单的应用程序来说太重了。JGoodies Swing 套件很贵,但幸运的是它的库是免费的。

Has anyone any real-world experience of new UFaceKit. It looks promising, but quite immature. I am particularly interested in Swing implementation and documentation. Any insight on UFaceKits development schedule would be appreciated, because I can hold by framework choice for a while. Requirements are not anything fancy, just working binding with a nice API.

有没有人对新的UFaceKit有任何实际体验。它看起来很有希望,但相当不成熟。我对 Swing 的实现和文档特别感兴趣。对 UFaceKits 开发计划的任何见解将不胜感激,因为我可以通过框架选择持有一段时间。需求不是什么花哨的东西,只是使用一个很好的 API 进行绑定。

I also found Mogwai dataBinding, but it seems quite incomplete and requires manual synchronization activation, which makes it useless compared to coarse grained synchronization easily written by hand.

我也找到了Mogwai dataBinding,但它似乎很不完整,需要手动同步激活,这与手动编写的粗粒度同步相比毫无用处。

Incomplete frameworks include at least Spring RCPand many JSR-296 forks.

不完整的框架至少包括Spring RCP和许多 JSR-296 分支。

So, is the JGoodies data binding really the only realistic choice? Or are there any other viable solutions available?

那么,JGoodies 数据绑定真的是唯一现实的选择吗?或者还有其他可行的解决方案吗?



Edit:
This question seems to rank quite high in google and the accepted answer reflects the time question was originally asked. Anyone who seeks to build new swing application that uses databinding should check all the answers, they have information about latest progress in this area.

编辑:
这个问题在谷歌中的排名似乎很高,接受的答案反映了最初提出问题的时间。任何寻求构建使用数据绑定的新 Swing 应用程序的人都应该检查所有答案,他们有关于该领域最新进展的信息。

采纳答案by Kevin Day

BBB(pretty much the official fork of JSR 295) works just fine.

BBB(几乎是 JSR 295 的官方分支)工作正常。

回答by Michael Karneim

The Beanfabrics framework contains some sort of data binding. In fact it is an implementation of the Presentation Model pattern: http://code.google.com/p/beanfabrics/

Beanfabrics 框架包含某种数据绑定。事实上,它是 Presentation Model 模式的一个实现:http: //code.google.com/p/beanfabrics/

回答by Marcos Vasconcelos

This project also has a data binding to forms that's easy to use, I'm created this project 2 years ago and it's growing from my ideas and some collaborators since that.

这个项目还有一个易于使用的表单数据绑定,我在 2 年前创建了这个项目,从那以后它从我的想法和一些合​​作者中发展起来。

https://github.com/MarkyVasconcelos/Towel

https://github.com/MarkyVasconcelos/Towel

回答by Paul Verest

We are going to use now Eclipse WindowBuilder, and I think it should go well

我们现在将使用Eclipse WindowBuilder,我认为它应该会很好

See Swing Data Binding Exampleat http://code.google.com/javadevtools/

挥杆数据绑定实施例http://code.google.com/javadevtools/

It is uses beansbinding-1.2.1.jar, that is jdesktop.org project. If it is related to JSR-295, I don't know (please edit)

它使用 beansbinding-1.2.1.jar,即 jdesktop.org 项目。如果它与JSR-295有关,我不知道(请编辑)

回答by Jose Luis Martin

I'm writing a library that has support for Swing data binding using Views, Binders and ControlAccessors for Swing Components.

我正在编写一个支持 Swing 数据绑定的库,该库使用 Swing 组件的视图、绑定器和 ControlAccessors。

See http://www.jdal.org/doc/swing/jdal-swing-binding.php

http://www.jdal.org/doc/swing/jdal-swing-binding.php

回答by cchantep

Melasse project can glue UI and beans togather w/o creating class: Binder.bind(/* source, target, options */).

Melasse 项目可以将 UI 和 bean 粘合在一起,而无需创建类:Binder.bind(/* source, target, options */).

e.g. To enable an action/button only when textfield is not empty: https://github.com/cchantep/melasse/blob/master/README.md#bind-buttonaction-to-provided-value.

例如,仅在文本字段不为空时启用操作/按钮:https: //github.com/cchantep/melasse/blob/master/README.md#bind-buttonaction-to-provided-value