Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » TemplateProposalProvider for webapplication(Possible to provide templates in the Xtext web editor ?)
TemplateProposalProvider for webapplication [message #1834752] Tue, 17 November 2020 12:13 Go to next message
Michiel Jonckheere is currently offline Michiel JonckheereFriend
Messages: 1
Registered: November 2020
Junior Member
Hello,

I am currently trying to use Xtext to create a structured editor. The reason that I chose Xtext is that it has also a web editor.

I have been experimenting with it, and one of the main features that it should have is the auto-completion, by using some templates. I was able to create templates that can be used in the eclipse application, but these don't work in the web editor. The templates are located in `<package>.ui/templates/templates.xml`.

I also found another way to create the templates, which is used in the statemachine web example (https://github.com/eclipse/xtext-web/tree/8edb0503934e7e649317097de8558cdfa9ec9102). In the ide/src folder, they have a class which extends the AbstractIdeTemplateProposalProvider. I have tried to create the same classes as they have done (a TemplateProposalProvider and a ContentProposalProvider) and in the IdeModule.java class, I added the bindIdeContentProposalProvider method. When I build the web editor again, it wouldn't load properly (no editor, only the title is visible) and in the eclipse editor the new template I made was not available.
In the attachments I added some screenshots of the code I currently have.

Does someone know how I should use the AbstractIdeTemplateProposalProvider properly so it will work in the web editor? I can not find a tutorial that makes use of it... Or is there another possible way to provide auto-compete templates in the web editor?


Thanks in advance for your response.
Re: TemplateProposalProvider for webapplication [message #1834772 is a reply to message #1834752] Tue, 17 November 2020 16:16 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13991
Registered: July 2009
Senior Member
hi, this (cursor and co) is an orion only feature
and yes you have to subclass and bind AbstractIdeTemplateProposalProvider
and delegate as StatemachineWebContentProposalProvider does


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 17 November 2020 16:20]

Report message to a moderator

Previous Topic:Can Ecore::EString be used in XText?
Next Topic:Disabling inter-file Cross referencing
Goto Forum:
  


Current Time: Mon Jun 21 05:16:04 GMT 2021

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

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

Back to the top