Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] texo template files in external plugin
icon1.gif  [Texo] texo template files in external plugin [message #1000263] Mon, 14 January 2013 06:52 Go to next message
Emanuele Gesuato is currently offline Emanuele Gesuato
Messages: 11
Registered: December 2012
Junior Member
Hi there,

first of all thanks for all the support you are putting in texo.

We have an our eclipse plugin where we are extending some of the (nice) features of texo providing a way to integrate our EMF-models with our custom annotations.

We are looking for integrate texo templates inside our plugin: so users will not have to worry about location of texo templates (for instance). But looking on texo source code it seems that is not possible to locate texo template in the plugin.

TexoResourceManager.getTemplateFolderPath returns template location but it is possible to overwrite this mechanism in order to look for template files inside our plugin ?

Thanks
Re: [Texo] texo template files in external plugin [message #1000294 is a reply to message #1000263] Mon, 14 January 2013 08:00 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Emanuele,
Not directly possible now, but it for sure seems an interesting thing to support. How would a path/url to these template
look like?
And how do you generate code, you call the code generator yourselve from a plugin (so programmatically), or do you use
the standard Texo menus?

gr. Martin

On 01/14/2013 12:52 PM, Emanuele Gesuato wrote:
> Hi there,
>
> first of all thanks for all the support you are putting in texo.
> We have an our eclipse plugin where we are extending some of the (nice) features of texo providing a way to integrate
> our EMF-models with our custom annotations.
>
> We are looking for integrate texo templates inside our plugin: so users will not have to worry about location of texo
> templates (for instance). But looking on texo source code it seems that is not possible to locate texo template in the
> plugin.
> TexoResourceManager.getTemplateFolderPath returns template location but it is possible to overwrite this mechanism in
> order to look for template files inside our plugin ?
>
> Thanks


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] texo template files in external plugin [message #1000304 is a reply to message #1000294] Mon, 14 January 2013 08:26 Go to previous messageGo to next message
Emanuele Gesuato is currently offline Emanuele Gesuato
Messages: 11
Registered: December 2012
Junior Member
Thanks for the quick response !

We would like to put templates files in a source folder of our plugin.
I think something like this:

this.getClass().getClassLoader().getResourceAsStream("com/myplugin/templates/mytemplate.xpt")


could do the job.

We are also calling code generation programmatically. But I think it could be great to support both: standard texo menu and "custom" call.


Thanks again,
Emanuele
Re: [Texo] texo template files in external plugin [message #1000322 is a reply to message #1000304] Mon, 14 January 2013 09:24 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Emanuele,
Can you enter a bugzilla for this? I am not sure if it has the highest priority. If you contribute some code that would
help ofcourse :-).

If you generate code programmatically then you can tell Texo to use your specific TexoResourceManager. The
TexoResourceManager is a TexoComponent and can be replaced by your own implementation:
http://wiki.eclipse.org/Texo/Components

In the artifactgenerator it can be set explicitly also.

This would be a solution for you?

gr. Martin


On 01/14/2013 02:26 PM, Emanuele Gesuato wrote:
> Thanks for the quick response !
>
> We would like to put templates files in a source folder of our plugin.
> I think something like this:
>
> this.getClass().getClassLoader().getResourceAsStream("com/myplugin/templates/mytemplate.xpt")
>
> could do the job.
>
> We are also calling code generation programmatically. But I think it could be great to support both: standard texo menu
> and "custom" call.
>
>
> Thanks again,
> Emanuele


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] texo template files in external plugin [message #1000812 is a reply to message #1000322] Tue, 15 January 2013 08:13 Go to previous message
Emanuele Gesuato is currently offline Emanuele Gesuato
Messages: 11
Registered: December 2012
Junior Member
Hi Martin,

We are using a custom implementation of TexoResourceManager and it is working like a charm ! It is a perfect solution, thanks.

Emanuele
Previous Topic:texo webservice support for nested packages
Next Topic:How to change the default fill color of EClasses in the Ecore Tools Diagram Editor?
Goto Forum:
  


Current Time: Fri Jul 25 12:00:31 EDT 2014

Powered by FUDForum. Page generated in 0.02840 seconds