java - 是否有用于 Eclipse 3.4 的 jface 数据绑定(bind)框架的良好示例和文档?

标签 java eclipse data-binding jface

官方网站非常稀少,大多数示例与 EMF 相关并且针对 Eclipse 3.5 但是如果使用 3.4 目标 Eclipse 平台并且不使用 EMF 怎么办。 我对 Tree Viewer 示例特别感兴趣,但是好的示例和文档总是值得赞赏的。

最佳答案

这里有一些很好的资源:

我认为 eclipse 3.4 和 3.5 中的 JFace 数据绑定(bind)之间没有重大区别。概念仍然相同(ISWTObservables 等)。

编辑

Lars Vogel使用以下代码演示可观察的列表查看器:

// Define the viewer
viewer = new ListViewer(parent);
viewer.setContentProvider(new ObservableListContentProvider());
List<Person> persons = new ArrayList<Person>();
// Just for testing we create sample data
createExampleData(persons);
input = new WritableList(persons, Person.class);
// Set the writeableList as input for the viewer
viewer.setInput(input);

介绍鼓励这也适用于 TreeViewers。您需要的 Content Provider org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider。它有点复杂,因为您需要一个列表工厂和一个 TreeStructureAdvisor 来构建这个内容提供者。这就是我能提供的所有帮助。也没有找到示例,到目前为止也没有对树查看器使用数据绑定(bind)。所以从现在开始,JFace API 文档必须成为您的 friend ;)

关于java - 是否有用于 Eclipse 3.4 的 jface 数据绑定(bind)框架的良好示例和文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1858682/

相关文章:

c# - 在 Winforms C# 中调试数据绑定(bind)?

c# - ITypedList 替代品?

java - java中有没有返回系统主题颜色的方法?

java - 找不到具有 preferredID 的 TopComponent

java - 为什么我会收到 bean 'com.mypackage.service.blog.BlogService' 的 NoSuchBeanDefinitionException

javascript - 如何通过 Angular 函数更新 View

java - 将参数传递给Hadoop中的映射函数

java.lang.UnsatisfiedLinkError 和 ADB 中的未知错误

Android debuggable=false 导致 jQuery.ajax POST 在 Cordova/Phonegap Eclipse 项目中失败

java - 脚本错误: "An error has occured in the script on the page"