Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » decoration applied twice
decoration applied twice [message #498474] Tue, 17 November 2009 08:13
Sven Krause is currently offline Sven KrauseFriend
Messages: 119
Registered: July 2009
Senior Member
Hi,

I've added a very simple ILabelDecorator decorating an own node type.

<extension
point="org.eclipse.ui.decorators">
<decorator adaptable="false" class="...ElementDecorator"
id="..."
label="..."
lightweight="false"
state="true">
<enablement>
<objectClass
name="....model.ElementNode">
</objectClass>
</enablement>
</decorator>
</extension>

The decoration is activated through the DecoratingLabelProvider.

public class ModelBrowserDecoratingLabelProvider extends
DecoratingLabelProvider {
public ModelBrowserDecoratingLabelProvider() {
super(new PrivateLabelProvider(),
PlatformUI.getWorkbench().getDecoratorManager().getLabelDeco rator());
}
}

My problem is that the ElementDecorator is called twice: one via the
org.eclipse.jface.viewers.DecoratingLabelProvider.getText(Ob ject) method
and once via the
org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider. getStyledText(Object)
method.

Where the getStyleText does not consider the already created decoration
suffix. It does not matter, if I use an ILabelDecorator or an
ILightweightLabelDecorator (respective extension config).

Whats wrong? Should I not use the DecoratingLabelProvider directly?

Thanks in advance.
Sven
Previous Topic:Single Checkbox Tree Viewer or Radio Tree Viewer?
Next Topic:Lazy and Deferred TreeViewer questions
Goto Forum:
  


Current Time: Thu Apr 25 16:12:08 GMT 2024

Powered by FUDForum. Page generated in 0.02578 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top