Nevermind...
This was a me problem.
For those who like me were confused...
I had two issues:
1) I did not use @Inject
2) I didn't understand that the IEObjectDescription comes from my model.
public class MyDslLabelProvider extends DefaultEObjectLabelProvider {
@Inject
public MyDslLabelProvider (AdapterFactoryLabelProvider delegate) {
super(delegate);
}
public String text(ElementToRelabel ele){
return "prefix" + ele.getName();
}
where ElementToRelabel is any of your parser rules that you set up.
i.e. if you have something like this in your .xtext:
Entity:
'entity' name=ID '{'
...
'}';
Then to relabel an Entity:
public String text(Entity entity){
return "Entity: " + entity.getName();
}
It will still work if you don't use @Inject, but you lose the graphical decorators on the outline.
This is useful at the moment for me to relabel some "<unnamed>" elements in my outline tree.
public String text(UnNamedThing noname){
return "A fixed string";
}
I still might potentially remove them from the tree, but for now giving them a name helps me to visualize things a bit.