CompilationUnitContext context= ((CompilationUnitContextType) fContextType).createContext(document, completionPosition, selection.y, compilationUnit);
CompilationUnitContext context= ((CompilationUnitContextType) fContextType).createContext(document, position, compilationUnit);
	public void complete(ITextViewer viewer, int completionPosition, ICompilationUnit compilationUnit) {	    IDocument document= viewer.getDocument();		if (!(fContextType instanceof CompilationUnitContextType))			return;		Point selection= viewer.getSelectedRange();		// remember selected text		String selectedText= null;		if (selection.y != 0) {			try {				selectedText= document.get(selection.x, selection.y);			} catch (BadLocationException e) {}		}		CompilationUnitContext context= ((CompilationUnitContextType) fContextType).createContext(document, completionPosition, selection.y, compilationUnit);		context.setVariable("selection", selectedText); //$NON-NLS-1$		int start= context.getStart();		int end= context.getEnd();		IRegion region= new Region(start, end - start);		Template[] templates= JavaPlugin.getDefault().getTemplateStore().getTemplates();		if (selection.y == 0) {			for (int i= 0; i != templates.length; i++)				if (context.canEvaluate(templates[i]))					fProposals.add(new TemplateProposal(templates[i], context, region, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));		} else {			if (context.getKey().length() == 0)				context.setForceEvaluation(true);			boolean multipleLinesSelected= areMultipleLinesSelected(viewer);			for (int i= 0; i != templates.length; i++) {				Template template= templates[i];				if (context.canEvaluate(template) &&					template.getContextTypeId().equals(context.getContextType().getId()) &&					(!multipleLinesSelected && template.getPattern().indexOf($_WORD_SELECTION) != -1 || (multipleLinesSelected && template.getPattern().indexOf($_LINE_SELECTION) != -1)))				{					fProposals.add(new TemplateProposal(templates[i], context, region, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));				}			}		}	}