Bug 31229 code templates pref page: opening a dialog on typing is unexpected [code manipulation]
20030206 when i start typing (or even press an arrow key) in the template preview a dialog pops up it's unexpected and unusual
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java
return viewer;
	}
	
	protected Template[] getTemplateOfCategory(boolean isComment) {
		ArrayList res=  new ArrayList();
		Template[] templates= fTemplates.getTemplates();
		for (int i= 0; i < templates.length; i++) {
			Template curr= templates[i];
			if (isComment == curr.getName().endsWith(CodeTemplates.COMMENT_SUFFIX)) {
				res.add(curr);
			}
		}
		return (Template[]) res.toArray(new Template[res.size()]);
	}
	
	protected static boolean canEdit(List selected) {
		return selected.size() == 1 && (selected.get(0) instanceof Template);
	}	
	
	protected void updateSourceViewerInput(List selection) {
		if (fPatternViewer == null || fPatternViewer.getTextWidget().isDisposed()) {
			return;
		}
		if (selection.size() == 1 && selection.get(0) instanceof Template) {
			Template template= (Template) selection.get(0);
			fPatternViewer.getDocument().set(template.getPattern());
		} else {
			fPatternViewer.getDocument().set(""); 
		}