for (int i= 0; i != templates.length; i++) if (context.canEvaluate(templates[i])) fProposals.add(new TemplateProposal(templates[i], context, region, viewer, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));
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, viewer, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));  } else { context.setForceEvaluation(true); for (int i= 0; i != templates.length; i++) { Template template= templates[i]; if (context.canEvaluate(template) && template.getPattern().indexOf("${cursor}") != -1) fProposals.add(new TemplateProposal(templates[i], context, region, viewer, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE))); } }
	public void complete(ITextViewer viewer, int completionPosition, ICompilationUnit compilationUnit)		throws JavaModelException	{	    IDocument document= viewer.getDocument();	    		// prohibit recursion		if (LinkedPositionManager.hasActiveManager(document))			return;		if (!(fContextType instanceof CompilationUnitContextType))			return;				((CompilationUnitContextType) fContextType).setContextParameters(document, completionPosition, compilationUnit);		CompilationUnitContext context= (CompilationUnitContext) fContextType.createContext();		int start= context.getStart();		int end= context.getEnd();		IRegion region= new Region(start, end - start);		Template[] templates= Templates.getInstance().getTemplates();		for (int i= 0; i != templates.length; i++)			if (context.canEvaluate(templates[i]))				fProposals.add(new TemplateProposal(templates[i], context, region, viewer, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_TEMPLATE)));	}