[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Code Templates - Contexts and re-use

Hi,

I have implemented a very complex template system for JBuilder called
Advanced Templates.  My company is moving to eclipse, so I am going to port
it to eclipse soon.  It can do a lot of stuff...  Check it out if you like,
on CodeCentral

http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15671


"Mikko Kamarainen" <mikko.kamarainen@xxxxxxxxxxxxxxxxxx> wrote in message
news:a25sqv$tqb$1@xxxxxxxxxxxxxxxx
>
> Starting to make my own code templates (an excellent feature in Eclipse
> BTW!) and this came to mind: now there seems to be 2 possible contexts for
> templates: java and javadoc - but how about 1) more general (non java)
> contexts and 2) subcontexts?
>
> 1) more general context - user-definable: xml, jsp, html etc. - according
> to file type - this can now be accomplished by defining java or java
> scrapbook editor as the default editor for such a type and defining the
> templates under java context - but then they are in the wrong place...
>
> 2) the more complex the templates get, the more one could use hierarchical
> contexts - once a template has been selected, it could be nice to have
> sub-templates that only apply within the selected template. I'm thinking:
a
> XDoclet template -> under this context one sees only the tag-templates
like
> ejb:bean name="${name}".. or @jboss:... etc.
>
> Also, can someone think of a way to add the following functionality to
> templates:
>  - description for variables for the user: @ejb:bean name="${name}" - the
> name could have the description from XDoclet docs.
>  - simple choosing from a pre-defined list for the value of a variable
like
> true/false for @ejb:bean generate="true/false"
>
> After that I only need to figure out how to get XDoclet to run under
> Eclipse - now the built-in ant fails where the same build.xml runs fine
> externally...
>
> --
> Mikko Kamarainen
> mikko.kamarainen@xxxxxxxxxxxxxxxxxx