I added a decorator in the Eclipse / RCP application to my tree view elements using plugin.xml:
<extension point="org.eclipse.ui.decorators"> <decorator adaptable="true" class="sernet.verinice.samt.rcp.TopicDecorator" id="sernet.verinice.samt.rcp.TopicDecorator" label="ISA Topic decorator" lightweight="true" location="BOTTOM_LEFT" state="true"> <enablement> <objectClass name="sernet.verinice.model.samt.SamtTopic"/> </enablement> </decorator>
In the decorator class, I set a decorative suffix that works fine:
public class TopicDecorator extends LabelProvider implements ILightweightLabelDecorator, { ControlMaturityService maturityService = new ControlMaturityService(); @Override public void decorate(Object element, IDecoration decoration) { decoration.addSuffix( new StringBuilder().append(" [") .append(maturityService.getWeightedMaturity((IControl)element)) .append("]").toString() ); decoration.setForegroundColor(new Color(Display.getCurrent(), 150,90,90)); }
As you can see, I also tried to set the foreground color, which has no effect. The suffix has the same color as the label in the tree: black.
How can I set the color of the decorative suffix?
source share