viewer.getDocument().set(template.getPattern());
IDocument doc= viewer.getDocument();  String start= null; if ("javadoc".equals(contextId)) { start= "/**" + doc.getLegalLineDelimiters()[0]; } else start= "";  doc.set(start + template.getPattern()); int startLen= start.length(); viewer.setDocument(doc, startLen, doc.getLength() - startLen);
	protected void updateViewerInput() {		IStructuredSelection selection= (IStructuredSelection) getTableViewer().getSelection();		SourceViewer viewer= getViewer();				if (selection.size() == 1 && selection.getFirstElement() instanceof TemplatePersistenceData) {			TemplatePersistenceData data= (TemplatePersistenceData) selection.getFirstElement();			Template template= data.getTemplate();			TemplateContextType type= JavaPlugin.getDefault().getTemplateContextRegistry().getContextType(template.getContextTypeId());			fTemplateProcessor.setContextType(type);			viewer.getDocument().set(template.getPattern());		} else {			viewer.getDocument().set(""); //$NON-NLS-1$		}			}