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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With