Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Dynamic Template Proposals in Xtext
Dynamic Template Proposals in Xtext [message #870738] Wed, 09 May 2012 13:46
Gianluca Viscomi is currently offline Gianluca ViscomiFriend
Messages: 33
Registered: April 2012
Location: Italy
I have a problem with the template! In practice I should view them with the content assist in a certain context, I tried this but these do not appear anywhere in that context! This is what I did:




'HASH' '(' (stringValue=STRING ',' bytes=Bytes ',' integer=INT) ')'


public class EditorSqlUiModule extends org.xtext.ui.AbstractEditorSqlUiModule {

public EditorSqlUiModule(AbstractUIPlugin plugin) {

public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider(){
return MyTemplateProposalProvider.class;

public class MyTemplateProposalProvider extends DefaultTemplateProposalProvider{

ContextTypeIdHelper helper;

public MyTemplateProposalProvider(TemplateStore templateStore,
ContextTypeRegistry registry, ContextTypeIdHelper helper) {
super(templateStore, registry, helper);



EditorSqlGrammarAccess grammaraccess;

protected void createTemplates(TemplateContext templateContext,
ContentAssistContext context, ITemplateAcceptor acceptor) {

super.createTemplates(templateContext, context, acceptor);

String id=helper.getId(grammaraccess.getHashFunctionRule());

Template template=new Template("TemplateProva","proviamo se funziona","11111","${t},${v},${yu},${ke}",false);

TemplateProposal tp= createProposal(template, templateContext, context, getImage(template), getRelevance(template));


The problem is that after I write HASH with Ctrl-space I is proposed Template!
Can anyone tell me how?
Previous Topic:need explanation regarding assignments
Next Topic:Outline View flicker
Goto Forum:

Current Time: Sun Nov 29 08:24:03 GMT 2020

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

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

Back to the top