如何在Eclipse Kepler中编写图像?

时间:2013-09-16 12:41:16

标签: java eclipse image decorator eclipse-plugin

这是Items decorations in a TreeViewer的后续内容:我有一个带有我自己的对象的TreeView。我已经有LabelProvider提供图标和文字。现在我想根据某些条件用其他图像装饰图像。我怎样才能做到这一点?引用的问题使用ComposedImage,我认为是org.eclipse.emf.edit.provider

有没有办法在Eclipse 4.3中使用SWT / JFace执行此操作?

我已经尝试使用ILightweightLabelDecorator(使用FAQ中的想法),但放弃围绕我的LabelProvider进行换行。

2 个答案:

答案 0 :(得分:1)

ILightweightLabelDecorator确实是最好的方法。使用DecoratingLabelProvider包装您的标签提供程序,如本答案中所述:Using a ILightweightLabelDecorator decorator使用org.eclipse.ui.decorators扩展点声明您的轻量级装饰器。

答案 1 :(得分:1)

您可能希望查看装饰提供商基本上使用的org.eclipse.jface.viewers.DecorationOverlayIcon

相关问题