Bug 39783 [preferences] template editor in preferences should honor partition type
200307030800 1. Preferences, Java->Editor->Templates 2. Add a template for javadoc 3. syntax highlighting shows default (java) partition type highlighting -> should respect partition type setting, e.g. initialize the viewer with javadoc
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaTemplatePreferencePage.java
Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
		viewer.getTextWidget().setFont(font);
		new JavaSourcePreviewerUpdater(viewer, configuration, store);
		
		Control control= viewer.getControl();
		data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
		control.setLayoutData(data);
		
		return viewer;
	}
	
	
	/*
	 * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#updateViewerInput()
	 */
	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(""); 
		}		
	}
}