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
}
	
	protected void doKeyInSourcePressed() {
		List selected= fCodeTemplateTree.getSelectedElements();
		if (canEdit(selected)) {
			doButtonPressed(IDX_EDIT, selected);
		}
	}
	
	
	protected void doButtonPressed(int buttonIndex, List selected) {
		if (buttonIndex == IDX_EDIT) {
			edit((Template) selected.get(0));
		} else if (buttonIndex == IDX_EXPORT) {
			export(selected);
		} else if (buttonIndex == IDX_EXPORTALL) {
			exportAll();
		} else {
			import_();
		}
	}
	
	private void edit(Template template) {
		Template newTemplate= new Template(template);
		EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true, false, new String[0]);
		if (dialog.open() == EditTemplateDialog.OK) {
			
			template.setDescription(newTemplate.getDescription());
			template.setPattern(newTemplate.getPattern());
			fCodeTemplateTree.refresh(template);