在我的 Eclipse RCP 视图中,我使用 JFace 数据绑定将模型数据绑定到org.eclipse.jface.viewers.TreeViewer
. 我ViewerSupport.bind()
用来绑定数据,如片段所示,它工作得很好。
ViewerSupport.bind(viewer, model, BeanProperties.list("children",
ModelObject.class), BeanProperties.value(ModelObject.class, "name"));
现在我真的很想在节点上显示图像以及文本。如果没有数据绑定,我只会覆盖 aLabelProvider
的getImage(Object element)
方法,但内容 + 标签提供程序方法和使用ViewerSupport
不能一起工作。ViewerSupport
我还没有在API中找到解决我的问题的方法。有没有解决方案,也许使用org.eclipse.core.databinding.property.value.IValueProperty
s?