Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Customize "hover-support" for non-grammer EObjects
Customize "hover-support" for non-grammer EObjects [message #1196326] Tue, 19 November 2013 11:06 Go to next message
Till Fischer is currently offline Till FischerFriend
Messages: 57
Registered: August 2012
Member
Hi,

I'm trying to customize Xtexts' "hover-support" (this yellow box showing some infos about the element under the mouse curser). It was easy to follow the instructions in these two blog posts (thanks for this):

http://ckulla.wordpress.com/2011/02/06/hover-support-in-xtext-2-0/

http://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/

Now the problem: I refer to elements from another EPackage in my grammer (generated from a plain ecore model). Since the Xtext-generated editor for my language always supported "hovering" on such elements, I expected customizing corresponding yellow boxes shouldn't be any different.

Unfortunately my custom implementation of an EObjectHoverProvider is only called for EObjects of my grammer. But I can see that the base class (DefaultEObjectHoverProvider) is used for non-grammer EObjects. This means that in principle Xtexts' hovering implementation handles non-grammer elements as desired, but my custom EObjectHoverProvider is not involved. This is how it is registered in the UIModule of my grammer:

public Class<? extends IEObjectHoverProvider>
    bindIEObjectHoverProvider()
{
    return MyLanguageEObjectHoverProvider.class;
}

public Class<? extends IEObjectDocumentationProvider>
    bindIEObjectDocumentationProviderr()
{
    return MyLanguageEObjectDocumentationProvider.class;
}


Can I do something to get this working without modifying Xtext framework code? I fear that this might be a bug...

Thanks,
Till

[Updated on: Tue, 19 November 2013 13:59]

Report message to a moderator

Re: Customize "hover-support" for non-grammer EObjects [message #1196864 is a reply to message #1196326] Tue, 19 November 2013 16:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6483
Registered: July 2009
Senior Member
Hi,

have a look at

org.eclipse.xtext.ui.editor.hover.DispatchingEObjectTextHover.getHoverInfo(EObject, ITextViewer, IRegion)

=> you have to bind the stuff in subclass of EmfUiModule in your resourceserviceprovider plugin too.
Re: Customize "hover-support" for non-grammer EObjects [message #1197029 is a reply to message #1196864] Tue, 19 November 2013 18:16 Go to previous message
Till Fischer is currently offline Till FischerFriend
Messages: 57
Registered: August 2012
Member
Christian Dietrich wrote on Tue, 19 November 2013 11:36
=> you have to bind the stuff in subclass of EmfUiModule in your resourceserviceprovider plugin too.


Indeed. Embarrassed
Previous Topic:Headless generator for a DSL with dependencies to another DSL
Next Topic:Call-hierarchy support
Goto Forum:
  


Current Time: Sat Nov 22 03:18:35 GMT 2014

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

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