Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Beginner problem(How to implement Hovers(Dynamic Yellow Frames :) ) with XText 2.0)
icon5.gif  Beginner problem [message #695702] Tue, 12 July 2011 11:21 Go to next message
Caner Friend
Messages: 98
Registered: July 2011
Member
Hello

I want to implement a kind of assistant, which is a dynamic yellow frame to display information about the rule or type while coding.
For instance ,it has to be ;
when the mouse indicates on a particular type,the frame has to come up dynamically and display information just like javadocs,

I need some clues, look forward to hear back

Caner

[Updated on: Wed, 13 July 2011 11:28]

Report message to a moderator

Re: Beginner problem [message #695705 is a reply to message #695702] Tue, 12 July 2011 11:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

am note quite sure but this works out of the box using Xtext 2.0.0. see e.g. http://ckulla.wordpress.com/2011/02/06/hover-support-in-xtext-2-0/
you have basically to implement IEObjectDocumentationProvider afaik

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 12 July 2011 11:33]

Report message to a moderator

Re: Beginner problem [message #695707 is a reply to message #695705] Tue, 12 July 2011 11:33 Go to previous messageGo to next message
Caner Friend
Messages: 98
Registered: July 2011
Member
Hi Christian !
Good to hear you back Smile, i gonna look into the link, Thank you

[Updated on: Tue, 12 July 2011 11:34]

Report message to a moderator

Re: Beginner problem [message #696074 is a reply to message #695702] Wed, 13 July 2011 08:19 Go to previous messageGo to next message
Timo Missing name is currently offline Timo Missing nameFriend
Messages: 12
Registered: March 2011
Junior Member
you basically just need to extend DispatchingEObjectTextHover and overwrite the method getHoverInfo(...).

It took me a while to find out how to bind the extended class:

Generate a class MyDslCompositeHover, copy the contents of DefaultCompositeHover and change the inject of htmlHover to your own EObjectTextHover

Finally add this to MyDslUiModule
public Class<? extends org.eclipse.jface.text.ITextHover> bindITextHover() {
return MyDslCompositeHover.class;
}


That's what I'm using, it works fine Smile


Re: Beginner problem [message #696110 is a reply to message #696074] Wed, 13 July 2011 09:40 Go to previous messageGo to next message
Caner Friend
Messages: 98
Registered: July 2011
Member
Thank you so much Timo, I was still searching,
There are some articles which are written min. 1 year ago.
However, I couldn't find any tutorial/article about Hover implementation with X Text 2.0
please if you know, share with me.
Now i will try to do your suggestion and come back Wink
Re: Beginner problem [message #696156 is a reply to message #696110] Wed, 13 July 2011 11:49 Go to previous message
Caner Friend
Messages: 98
Registered: July 2011
Member
can you give me a sample about overriding getHoverInfo?
Previous Topic:XtextCellEditor usable in a JFace Tableviewer?
Next Topic:beginner question about outline and label
Goto Forum:
  


Current Time: Tue Apr 16 18:44:50 GMT 2024

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

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

Back to the top