Skip to main content



      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 13:28 Go to next message
Eclipse UserFriend
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 15:08 Go to previous message
Eclipse UserFriend
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
Previous Topic:Provide model at runtime
Next Topic:Get all nodes of a given grammar construct type
Goto Forum:
  


Current Time: Sat Jul 12 17:17:13 EDT 2025

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

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

Back to the top