Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Trying to include templates.xml in xtext plugin
Trying to include templates.xml in xtext plugin [message #885756] Wed, 13 June 2012 14:36 Go to next message
Tim Student is currently offline Tim StudentFriend
Messages: 12
Registered: May 2012
Junior Member
Hi Guys,

I just read how to include templates out of an xml file to my Xtext plugin, but anyhow, it does not work. Therefore, I try to explain, what I have done. Hopefully someone can help me.

I created some templates out of the Window -> preferences page of my local eclipse-installation. Then I exported theese templates to an templates.xml.

I created a folder called templated in the org.xtext.xyz.mydsl.ui project, on the same directory level, as the src directory. I copied the templates.xml file inside it.

The content of my build.properties of the ui project looks like:

source.. = src/,\
          src-gen/
bin.includes = META-INF/,\
               .,\
               plugin.xml,\
               templates/


Have I somehow missed anything? I ran the mwe2 Workflow, generated the xtext artifacts and exported the plugin to the jar. files. When I include the file on another eclipse installation, the templates page in the preferences menu remains empty:-(

Thanks so far guys!
Re: Trying to include templates.xml in xtext plugin [message #885763 is a reply to message #885756] Wed, 13 June 2012 14:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
Hi have you codetemplatesgeneratorfragment added to the workflow and
did you merge plugin.XML_Gen and plugin.xml?


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
Re: Trying to include templates.xml in xtext plugin [message #885769 is a reply to message #885763] Wed, 13 June 2012 14:58 Go to previous messageGo to next message
Tim Student is currently offline Tim StudentFriend
Messages: 12
Registered: May 2012
Junior Member
Thanks for your reply.

The codetemplatesgeneratorfragment is present in the workflow.

But I am wondering, because the plugin.xml_gen and plugin.xml have equal content.
Do you have any Idea?
Re: Trying to include templates.xml in xtext plugin [message #885771 is a reply to message #885756] Wed, 13 June 2012 14:58 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
Tim,

you have to add ID tags to the exported templates in the XML file. See
the reference docs for details.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 13.06.12 16:36, schrieb Tim Student:
> Hi Guys,
> I just read how to include templates out of an xml file to my Xtext
> plugin, but anyhow, it does not work. Therefore, I try to explain, what
> I have done. Hopefully someone can help me.
>
> I created some templates out of the Window -> preferences page of my
> local eclipse-installation. Then I exported theese templates to an
> templates.xml.
>
> I created a folder called templated in the org.xtext.xyz.mydsl.ui
> project, on the same directory level, as the src directory. I copied the
> templates.xml file inside it.
>
> The content of my build.properties of the ui project looks like:
>
> source.. = src/,\
> src-gen/
> bin.includes = META-INF/,\
> .,\
> plugin.xml,\
> templates/
>
> Have I somehow missed anything? I ran the mwe2 Workflow, generated the
> xtext artifacts and exported the plugin to the jar. files. When I
> include the file on another eclipse installation, the templates page in
> the preferences menu remains empty:-(
>
> Thanks so far guys!
Re: Trying to include templates.xml in xtext plugin [message #885775 is a reply to message #885769] Wed, 13 June 2012 15:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13661
Registered: July 2009
Senior Member
No can you try it with a brand new mydsl project?

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
Re: Trying to include templates.xml in xtext plugin [message #885776 is a reply to message #885771] Wed, 13 June 2012 15:11 Go to previous message
Tim Student is currently offline Tim StudentFriend
Messages: 12
Registered: May 2012
Junior Member
That helped, great thanks to all of you!!!
Previous Topic:STRING serialization not producing quotes if no whitespace
Next Topic:Antlr equivalent to the '&' operator
Goto Forum:
  


Current Time: Sun Nov 29 20:56:40 GMT 2020

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

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

Back to the top