Bug 4139 EC DCR: Code templates feature (1GIVMDV)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateProposal.java
private ArgumentEvaluator fArgumentEvaluator;	
	/**
	 * Creates a template proposal with a template and the range of its key.
	 * @param template  the template
	 * @param arguments arguments to the template, or <code>null</code> for no arguments
	 * @param start     the starting position of the key.
	 * @param end       the ending position of the key (exclusive).
	 */	
	TemplateProposal(Template template, String[] arguments, int start, int end) {
		Assert.isNotNull(template);
		Assert.isTrue(start >= 0);
		Assert.isTrue(end >= start);
		
		fTemplate= template;
		fArgumentEvaluator= new ArgumentEvaluator(arguments);
		fStart= start;
		fEnd= end;		
	}
	/**
	 * @see ICompletionProposal#apply(IDocument)
	 */
	public void apply(IDocument document) {
		int indentationLevel= guessIndentationLevel(document, fStart);		
		String pattern= fTemplate.getPattern();
		
		pattern= fInterpolator.interpolate(pattern, fArgumentEvaluator);		
		pattern= fInterpolator.interpolate(pattern, fLocalVariableEvaluator);
		fCursorSelectionEvaluator.reset();
		pattern= fInterpolator.interpolate(pattern, fCursorSelectionEvaluator);