Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a ILightweightLabelDecorator decorator

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.

Martin.

like image 673
Martin Cowie Avatar asked Jul 21 '09 20:07

Martin Cowie


1 Answers

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()));

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.

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.

like image 62
JB. Avatar answered Sep 27 '22 16:09

JB.