eclipse超cool新特性--JFace Data Binding
2006-03-03 09:06
369 查看
现在eclipse M4已经出来了,其中一个最cool的非UI特性就是JFace data binding framework.
在M5发布的时候JFace binding小组会结束data binding API的开发.
到现在为止,大量我们可以用到JFace data binding的例子在test包里。
关于JFace data binding framework,在下面的网址可以找到具体的文档.
http://wiki.eclipse.org/index.php/JFace_Data_Binding
http://wiki.eclipse.org/index.php/JFace_Data_Binding_Scenarios
可以通过CVS很方便的下载到test包:
打开CVS Repositories View,选New-->Repository location
在窗口里依次填入:
Host: dev.eclipse.org
Repository path: /home/eclipse
User: anonymous
Password:空白
Connection type: pserver
展开HEAD...
“org.eclipse.jface.databinding”
“org.eclipse.jface.tests.databinding”
就是代码和测试代码了.
可以先运行检查配置是否正确:
1. 展开 org.eclipse.jface.tests.databinding
2. 展开 the org.eclipse.jface.tests.databinding package
3. 右击 “BindingTestSuite.java” 并选 “Run as | SWT Application”
如果终端出现一些....然后是测试多少个,具体log等,那就没问题了。
关于JFace data binding framework:
一般的UI都需要自己保存数据,然后向每个text,combo写监听器,然后返回到主程序中,非常繁琐,但是现在因为UI和data的绑定,简单地让人吃惊....
以我的财务管理程序举例来说,现在我只需要写完数据结构和图形界面,然后在代码里加上下面这样的代码:
IDataBindingContext dbc = DataBinding.createContext(composite);
dbc.bind(departmentCombo, new Property(depatments, "department"), null);
dbc.bind(projectCombo, new Property(depatments, "project"), null);
dbc.bind(dateText, new Property(depatments, "date), null);
dbc.bind(wareText, new Property(depatments, "ware"), null);
dbc.bind(priceText, new Property(depatments, "price"), null);
我不需要自己再很多的代码,只需要加上两个方法:
dialog.getDepartments()
dialog.setDepartments(...)
就完全搞定数据在UI和数据结构之间的传输:)
这里有一篇详细的How-to文章: http://www.coconut-palm-software.com/the_visual_editor/?p=57
在M5发布的时候JFace binding小组会结束data binding API的开发.
到现在为止,大量我们可以用到JFace data binding的例子在test包里。
关于JFace data binding framework,在下面的网址可以找到具体的文档.
http://wiki.eclipse.org/index.php/JFace_Data_Binding
http://wiki.eclipse.org/index.php/JFace_Data_Binding_Scenarios
可以通过CVS很方便的下载到test包:
打开CVS Repositories View,选New-->Repository location
在窗口里依次填入:
Host: dev.eclipse.org
Repository path: /home/eclipse
User: anonymous
Password:空白
Connection type: pserver
展开HEAD...
“org.eclipse.jface.databinding”
“org.eclipse.jface.tests.databinding”
就是代码和测试代码了.
可以先运行检查配置是否正确:
1. 展开 org.eclipse.jface.tests.databinding
2. 展开 the org.eclipse.jface.tests.databinding package
3. 右击 “BindingTestSuite.java” 并选 “Run as | SWT Application”
如果终端出现一些....然后是测试多少个,具体log等,那就没问题了。
关于JFace data binding framework:
一般的UI都需要自己保存数据,然后向每个text,combo写监听器,然后返回到主程序中,非常繁琐,但是现在因为UI和data的绑定,简单地让人吃惊....
以我的财务管理程序举例来说,现在我只需要写完数据结构和图形界面,然后在代码里加上下面这样的代码:
IDataBindingContext dbc = DataBinding.createContext(composite);
dbc.bind(departmentCombo, new Property(depatments, "department"), null);
dbc.bind(projectCombo, new Property(depatments, "project"), null);
dbc.bind(dateText, new Property(depatments, "date), null);
dbc.bind(wareText, new Property(depatments, "ware"), null);
dbc.bind(priceText, new Property(depatments, "price"), null);
我不需要自己再很多的代码,只需要加上两个方法:
dialog.getDepartments()
dialog.setDepartments(...)
就完全搞定数据在UI和数据结构之间的传输:)
这里有一篇详细的How-to文章: http://www.coconut-palm-software.com/the_visual_editor/?p=57
相关文章推荐
- eclipse超cool新特性--JFace Data Binding
- eclipse超cool新特性--JFace Data Binding
- jface databinding:UpdateValueStrategy(数值更新策略)类详解
- jface databinding:更简单的ISideEffect实现多目标单边数据绑定塈其原理分析
- jface databinding:重写doSetValue方法ComputedValue实现双向多对一的数据绑定
- jface databinding:List,Set,Map对象的Observable代理封装
- 采用jface dataBinding来实现内容填充
- jface databinding: Radio Button group及ISideEffect绑定数据对象的例子
- 谷歌I/O 2015 android 新特性 Data Binding Library(一)
- jface databinding/PojoBindable实现对POJO对象的支持
- jface databinding:输入无效数值时强制恢复初始值-updateModelToTarget
- jface databinding:构建一个改进版的通用型数值验证器StringToNumberValidator
- jface databinding:可多选的widget List组件selection项目与java.util.List对象的双向数据绑定
- jface databinding:label provider 实现多列表格(Table)数据绑定的两个途径
- jface databinding(数据挷定)中的数据转换(IConverter)和数据验证(IValidator )
- jface databinding: 创建readonly(只读)可观察对象(observable)
- jface databinding:延迟计算--ComputedValue和WritableList使用的例子
- JFace DataBinding 中的 MultiValidator学习和体会
- jface databinding:部分实现POJO对象的监测
- jface databinding:使用CheckboxTableViewer实现表中(Set)对象与CheckTable中选中条目数据绑定