Home » Modeling » TMF (Xtext) » Code templates
|
Re: Code templates [message #637338 is a reply to message #637332] |
Fri, 05 November 2010 06:49 |
|
Hi
I don't know whether this might solve the problem, but have you added
the templates directory in your build.properties so that it is included
in the binary build?
cheers
Lorenzo
On 11/05/2010 07:33 AM, pgbackup@yahoo.com wrote:
> Hi,
>
> I've created templates.xml and put in in a templates/ folder in the UI
> plugin. If I use the eclipse debug framework, I can see these templates
> in the Window->Preferences->MyDSL. However, when I create a stadnalone
> product configuration, while my plugins are working, these templates are
> not appearing. I've added the 'ID' attribute like this:
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <templates>
> <template autoinsert="false"
> context="org.xtext.example.hlm.MyHLM.Condition" deleted="false"
> description="" enabled="true" name="cond_template" ID="hlm2">cond
> (${condition}) { ${true_state} }</template> <template autoinsert="true"
> context="org.xtext.example.hlm.MyHLM.Default" deleted="false"
> description="" enabled="true" name="default template" ID="hlm3">default
> { ${default_state} }</template> <template autoinsert="false"
> context="org.xtext.example.hlm.MyHLM.State" deleted="false"
> description="" enabled="true" name="state_template" ID="hlm4">state
> ${state_name} { action { ${operation}; } cond (${condition}) {
> ${true_state} } default { ${default_state} } }</template> </templates>
>
>
> These plugins (along with others) are put in the dependencies of teh UI
> plugin:
>
> <plugin id="org.eclipse.xpand"/>
> <plugin id="org.eclipse.xtend"/>
> <plugin id="org.eclipse.xtend.typesystem.emf"/>
> <plugin id="org.eclipse.xtext"/>
> <plugin id="org.eclipse.xtext.builder"/>
> <plugin id="org.eclipse.xtext.common.types"/>
> <plugin id="org.eclipse.xtext.generator"/>
> <plugin id="org.eclipse.xtext.logging" fragment="true"/>
> <plugin id="org.eclipse.xtext.ui"/>
> <plugin id="org.eclipse.xtext.ui.shared"/>
> <plugin id="org.eclipse.xtext.util"/>
> <plugin id="org.eclipse.xtext.xtend"/>
> <plugin id="org.xtext.example.hlm"/>
> <plugin id="org.xtext.example.hlm.generator"/>
> <plugin id="org.xtext.example.hlm.ui"/>
>
>
> Is there some other dependency that I have to add to get this working?
> I've done 'Add required plugins' when I created the product
> configuration file and there are no missing dependencies (i.e,
> everythign is validated). Or maybe I need to set the ID attirbute to
> something special?
>
> Thanks.
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Re: Code templates [message #637474 is a reply to message #637338] |
Fri, 05 November 2010 17:15 |
No real name Messages: 101 Registered: August 2010 |
Senior Member |
|
|
Hi Lorenzo,
Thank you for your help. I have verified that the templates directory is included. Here is how my build.properties file looks like:
bin.includes = META-INF/,\
.,\
plugin.xml,\
lib/dom4j-1.6.1.jar,\
lib/poi-3.6-20091214.jar,\
lib/poi-ooxml-3.6-20091214.jar,\
lib/xmlbeans-2.3.0.jar,\
lib/poi-ooxml-schemas-3.6-20091214.jar,\
log4j.xml,\
templates/,\
templates/templates.xml, \
plugin_customization.ini,\
splash.bmp,\
icons/
source.. = src/,\
src-gen/
bin.excludes = META-INF/.svn/,\
templates/.svn/,\
icons/.svn/
jars.extra.classpath = lib/dom4j-1.6.1.jar,\
lib/poi-3.6-20091214.jar,\
lib/poi-ooxml-3.6-20091214.jar,\
lib/poi-ooxml-schemas-3.6-20091214.jar,\
lib/xmlbeans-2.3.0.jar
Just to be paranoid, I also added /templates/templates.xml, \ . I confirmed that the file is pesent by doing 'jar xf <jarfile>' so it is included in the UI plugin. But no templates are visible.
Thank you again.
|
|
|
Re: Code templates [message #637486 is a reply to message #637474] |
Fri, 05 November 2010 19:01 |
|
then probably templates are implemented in some plugins which are not
included as an automatic dependency?
On 11/05/2010 06:15 PM, pgbackup@yahoo.com wrote:
> Hi Lorenzo,
>
> Thank you for your help. I have verified that the templates directory is
> included. Here is how my build.properties file looks like:
>
>
> bin.includes = META-INF/,\
> .,\
> plugin.xml,\
> lib/dom4j-1.6.1.jar,\
> lib/poi-3.6-20091214.jar,\
> lib/poi-ooxml-3.6-20091214.jar,\
> lib/xmlbeans-2.3.0.jar,\
> lib/poi-ooxml-schemas-3.6-20091214.jar,\
> log4j.xml,\
> templates/,\
> templates/templates.xml, \
> plugin_customization.ini,\
> splash.bmp,\
> icons/
> source.. = src/,\
> src-gen/
> bin.excludes = META-INF/.svn/,\
> templates/.svn/,\
> icons/.svn/
> jars.extra.classpath = lib/dom4j-1.6.1.jar,\
> lib/poi-3.6-20091214.jar,\
> lib/poi-ooxml-3.6-20091214.jar,\
> lib/poi-ooxml-schemas-3.6-20091214.jar,\
> lib/xmlbeans-2.3.0.jar
>
>
> Just to be paranoid, I also added /templates/templates.xml, \ . I
> confirmed that the file is pesent by doing 'jar xf <jarfile>' so it is
> included in the UI plugin. But no templates are visible.
>
> Thank you again.
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| | | | | | | |
Goto Forum:
Current Time: Mon May 13 07:27:10 GMT 2024
Powered by FUDForum. Page generated in 0.03949 seconds
|