Add LabelDecoration to Project Explorer in Eclipse RCP Application

36 Views Asked by At

In our Eclipse RCP Application, we have done some UI revamp which involves replacement of default eclipse icons with our custom icons.

For the above we have added a Label Provider for Project Explorer via extension to replace new icons. Although, with this change the decoration colors have been removed.

For instance, the projects checked out from SVN Repository are no longer showing color decoration for repository name with yellow color (As selected in Preferences > Colors > Basic > Decoration color)

Similarly, color decoration is now missing for Java Resources such as Data Type and method return type.

Current Understanding of Common Navigator: When Project Explore is created, the label provider is set to

org.eclipse.ui.internal.navigator.NavigatorDecoratingLabelProvider

We did override this to our custom Label Provider which is defined as

public class CustomLabelProvider extends LabelProvider implements extends LabelProvider implements ILabelProvider, ICommonLabelProvider

It looks like NavigatorDecoratingLabelProvider cannot be directly extended by CustomLabelProvider.

Looking for solutions to be able to add a Decorating Capability, as per my understanding the following implementation in Decorator Manager gets all applicable decorators and apply the decoration:

String org.eclipse.ui.internal.decorators.DecoratorManager.decorateText(String text, Object element, IDecorationContext context)

0

There are 0 best solutions below