燃爆上海 5·23-24,AICon 大模型实战风暴,50+ 干货一网打尽,100% 日程上线 了解详情
写点什么

JSR 295 规范参考实现 Beans Binding 推出 1.0 版

  • 2007-09-24
  • 本文字数:579 字

    阅读完需:约 2 分钟

Shannon 表示,针对该 JSR 的工作仍将继续进行,而且可能导致 API 发生变化。不过,框架的 1.0 版确实通过以下的显著特性代表了对 Beans Binding API 架构的一个主要的重新实现:

// Bind Duke's first name to the text property of a Swing JTextField<br></br> BeanProperty textP = BeanProperty.create("text");<br></br> Binding binding =<br></br> Bindings.createAutoBinding(READ_WRITE, duke, firstP, textfield, textP);<br></br> binding.bind();<p>// Bind Duke's mother's first name to the text property of a Swing JTextField,</p><br></br>// specifying that the JTextField's text property only reports change<br></br>// (thereby updating the source of the READ_WRITE binding) on focus lost<br></br> BeanProperty textP = BeanProperty.create("text_ON_FOCUS_LOST");<br></br> Binding binding =<br></br> Bindings.createAutoBinding(READ_WRITE, duke, motherFirstP, textfield, textP);<br></br> binding.bind();

Beans Binding 所面向的是 Swing 的领域,在过去 Swing 领域曾经用过类似于 JGoodies Binding 这样的项目。另外的一个项目则是来自于 Eclipse Foundation 的 JFace Data Binding ,它为 SWT、JFace 和 JavaBeans 提供了核心的实现。不过这个框架早就为 Swing 和 EMF 这样的 API 留好了未来的扩展余地。

2007-09-24 09:301399
用户头像

发布了 117 篇内容, 共 18.0 次阅读, 收获喜欢 0 次。

关注

评论

发布
暂无评论
发现更多内容
JSR 295规范参考实现Beans Binding推出1.0版_Java_Scott Delap_InfoQ精选文章