Jump to: navigation, search

FAQ How do I add label decorations to my viewer?

Revision as of 15:21, 14 March 2006 by Claffra (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Suppose that your viewer contains model elements for which other plug-ins have defined label decorators. To make those decorations appear in your viewer, you need to install a decorating label provider. Assuming that you have already written your own basic label provider, simply do the following to add declarative decorations from other plug-ins:

   ILabelProvider lp = ... your basic label provider
   ILabelDecorator decorator = PlatformUI.getWorkbench().
         getDecoratorManager().getLabelDecorator();
   viewer.setLabelProvider(
         new DecoratingLabelProvider(lp, decorator));


See Also:

FAQ_What_is_a_label_decorator?

FAQ_How_do_I_create_a_label_decorator_declaratively?


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.