Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to add labels to outline view
How to add labels to outline view [message #894544] Mon, 09 July 2012 14:42 Go to next message
Martin Girschick is currently offline Martin GirschickFriend
Messages: 10
Registered: July 2009
Junior Member
As it seems, oAWs "EditorExtensions.ext" file, which allowed changes to the outline view has been replaced by a java based mechanism. The wizard creates a UI project with two classes named *DescriptionLabelProvider and *LabelProvider. The first one contains commented out code which doesn't work, because the visibility of the methods is not correct. If I change that for the text-Method (in both classes) it doesn't seem to make a difference. Should any one of them affect the outline view? Do I have to make other additions somewhere else? The example on the webpage seems to be incomplete concerning the specifics.

Any help appreciated Smile

Martin
Re: How to add labels to outline view [message #894587 is a reply to message #894544] Mon, 09 July 2012 17:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13360
Registered: July 2009
Senior Member
Hello Martin,

the following works for me in both Xtext 2.2.1 and 2.3.0 with the
Greeting example

public class MyDslLabelProvider extends DefaultEObjectLabelProvider {

	@Inject
	public MyDslLabelProvider(AdapterFactoryLabelProvider delegate) {
		super(delegate);
	}

	
	String text(Model ele) {
	  return "Modell";
	}
	
	String text(Greeting ele) {
		  return "Gruß: " + ele.getName();
	}
	
}


~Christian

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@xxxxxxxx


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add labels to outline view [message #894788 is a reply to message #894587] Tue, 10 July 2012 14:24 Go to previous message
Martin Girschick is currently offline Martin GirschickFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks. That indeed solved my problem - it wasn't clear to me, that I have to write separate methods for the different model classes.
Previous Topic:Xtext runtime with Java Runtime Environment 1.5 ?
Next Topic:Using xpand with xtext
Goto Forum:
  


Current Time: Wed Feb 26 07:32:56 GMT 2020

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

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

Back to the top