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

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

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)
	if (o instanceof AnImportedElement)
		return myDslUtils.retrieveHoverFirstLineAnImportedElement(
				(AnImportedElement) o, label);

could someone point me what am I missing ?


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: 13888
Registered: July 2009
Senior Member

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.


Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Provide model at runtime
Next Topic:Get all nodes of a given grammar construct type
Goto Forum:

Current Time: Thu Apr 22 15:36:47 GMT 2021

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

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

Back to the top