Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to customize hover for imported elements ?
How to customize hover for imported elements ? [message #938230] Tue, 09 October 2012 17:28 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi,

I setup the hover for the elements of my DSL properly using these two classes:
MyDslEObjectDocumentationProvider
MyDslEObjectHoverProvider

I need to add hover for some elements that are imported by my dsl too.

I have tried to add an if in the getFirstLine method of MyDslEObjectHoverProvider, but its never reached. For any element of my dsl it is working right:

protected String getFirstLine(EObject o) {
	
	String label = qualifiedNameProvider.getFullyQualifiedName(o)
			.toString();
	
	if (o instanceof AnImportedElement)
		return myDslUtils.retrieveHoverFirstLineAnImportedElement(
				(AnImportedElement) o, label);


could someone point me what am I missing ?

thanks,

Cristiano
Re: How to customize hover for imported elements ? [message #938316 is a reply to message #938230] Tue, 09 October 2012 19:08 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you usually to this in the dsl that provides the elements.
never the less: you may have a look at org.eclipse.xtext.ui.editor.hover.DispatchingEObjectTextHover.getHoverInfo(EObject, ITextViewer, IRegion)
there you can see that the stuff is done language specific. and i might be a place to hook in.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Provide model at runtime
Next Topic:Get all nodes of a given grammar construct type
Goto Forum:
  


Current Time: Thu Apr 18 08:53:21 GMT 2024

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

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

Back to the top