使用ILightweightLabelDecorator装饰器 [英] Using a ILightweightLabelDecorator decorator

查看:60
本文介绍了使用ILightweightLabelDecorator装饰器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经实现了上述方法之一,谁能说出我如何直接将其 连接到查看器?普通资料都没有解释.

Having implemented one of the above, can anyone say how I might wire it up directly to a viewer? None of the usual sources explain.

马丁.

推荐答案

据我所知,您需要一个ILabelDecorator,唯一获得方法的简单方法是使用工作台UI:

As far as I can tell you need an ILabelDecorator and the only easy way to get one is to use the workbench UI:

viewer.setLabelProvider(
    new DecoratingLabelProvider(new MyPlainLabelProvider(),
            PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));

然后,您需要将轻量级装饰器添加到plugin.xml中的装饰器扩展点.显然,这仅在您的应用程序是Eclipse插件的情况下有效.

You then need to add your lightweight decorator to the decorators extension point in the plugin.xml. Obviously, this will only work if your app is an Eclipse plugin.

ILightweightDecorator在JFace中似乎很奇怪,但是要使用它,您需要一个装饰器管理器,该装饰器管理器仅在org.eclipse.ui中实现.似乎没有一种简单的方法可以更直接地做到这一点.

It seems odd that ILightweightDecorator is in JFace, but to use it you need a decorator manager which is only implemented in org.eclipse.ui. There doesn't seem to be an easy way to do this more directly though.

这篇关于使用ILightweightLabelDecorator装饰器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆