Bug 4139 EC DCR: Code templates feature (1GIVMDV)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateProposal.java
int charactersRemoved= pattern.length() - finalString.length();
		fSelectionStart -= charactersRemoved;
		fSelectionEnd -= charactersRemoved;
		
		try {
			document.replace(fStart, fEnd - fStart, finalString);
		} catch (BadLocationException x) {} 
	}
	
	private static String trimBegin(String string) {
		int i= 0;
		while ((i != string.length()) && Character.isWhitespace(string.charAt(i)))
			i++;
		return string.substring(i);
	}
	/**
	 * @see ICompletionProposal#getSelection(IDocument)
	 */
	public Point getSelection(IDocument document) {
		return new Point(fStart + fSelectionStart, fSelectionEnd - fSelectionStart);
	}
	/**
	 * @see ICompletionProposal#getAdditionalProposalInfo()
	 */
	public String getAdditionalProposalInfo() {
		String pattern= fTemplate.getPattern();
		pattern= fInterpolator.interpolate(pattern, fArgumentEvaluator);		
		pattern= fInterpolator.interpolate(pattern, fLocalVariableEvaluator);
		pattern= fInterpolator.interpolate(pattern, fCursorSelectionEvaluator);