Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content assist formatted text with HTML mark-up
Content assist formatted text with HTML mark-up [message #1057924] Thu, 09 May 2013 20:03 Go to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi,

I am able to add documentation to support the content assist by calling the setAdditionalProposalInfo method on ConfigurableCompletionProposal and passing a string, however, it does not seem to support HTML mark-up.

I am however able to provide formatted text with HTML mark-up for hover support after insertion of a proposal item through custom hovers (as per http://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/).

My question is how can one support formatted text with HTML mark-up for content assist documentation?

Many thanks,

Dan

Re: Content assist formatted text with HTML mark-up [message #1058050 is a reply to message #1057924] Fri, 10 May 2013 15:55 Go to previous messageGo to next message
Steve Kallestad is currently offline Steve Kallestad
Messages: 62
Registered: March 2013
Member
I'm doing this in template proposals.

For template proposals, you need to override IInformationControlCreator getInformationControlCreator()

There are a couple of options to choose from, but I ended up going with "BrowserInformationControl".

I had to bring in a LOT of jface code for my template proposals and IIRC, the browser control was part of the reason why. jface has a lot of code that doesn't like to be overridden.

public class MyDSLTemplateProposal extends XtextTemplateProposal {
...
	@Override
	public IInformationControlCreator getInformationControlCreator() {	
		return new IInformationControlCreator() {
			
			@Override
			public IInformationControl createInformationControl(Shell parent) {
				IInformationControl iic =new BrowserInformationControl(parent, null, "woohoo");
				//IInformationControl iic = new DefaultInformationControl(parent);
				return iic;
			}
		};
	}
...
}

[Updated on: Fri, 10 May 2013 16:11]

Report message to a moderator

Re: Content assist formatted text with HTML mark-up [message #1058803 is a reply to message #1058050] Wed, 15 May 2013 07:41 Go to previous message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Steve,

Many thanks for the pointers. I ended up using DefaultInformationControl and passing a custom InformationPresenter.

Dan
Previous Topic:Generated metamodel forum Xtext
Next Topic:Single quotation marks consumed incorrectly
Goto Forum:
  


Current Time: Wed Oct 22 01:37:28 GMT 2014

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

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