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

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