Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-text-dev] template formatting

Tom,

We've used the newly pushed down template code to add rudamentry template
support to the ant editor via code assist and an extension point. We used
the following classes in our solution: ContextType, DocumentTemplateContext,
Template, TemplateContext, TemplateProposal.
I now need to format the templates to correct the indendentation, etc. 

Since formatting a template upon insertion will be required by most users of
the the template framework I seems to me we ought to add support for this in
the template API. It appears that the work of actually inserting the
template is done with TemplateProposal.apply(ITextViewer,char,int,int). What
do you think about adding a method to the TemplateProposal object such as
setTemplateFormatter(TemplateFormatter) which would allow the apply method
to format the template as part of the insertion. The apply method might
check to see if a formatter has been set and then call
TemplateFormatter.format(ITextViewer (or IDocument), int offset,
TemplateBuffer) or something to that effect. This is a fairly simple and
unobtrusive implementation that would likely be handy for most users of the
framework.

What do you think?


John-Mason Shackelford

Software Developer
Pearson Educational Measurement - eMeasurement Group

2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
john-mason.shackelford@xxxxxxxxxxx
http://etest.ncspearson.com 

**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************


Back to the top