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/EditTemplateDialog.java
if (name == null)
			return name;
		
		for (int i= 0; i < fContextTypes.length; i++) {
			if (name.equals(fContextTypes[i][1])) {
				return fContextTypes[i][0];	
			}
		}
		return name;
	}
	protected void doSourceChanged(IDocument document) {
		String text= document.get();
		fTemplate.setPattern(text);
		fValidationStatus.setOK();
		TemplateContextType contextType= fContextTypeRegistry.getContextType(fTemplate.getContextTypeId());
		if (contextType != null) {
			try {
				contextType.validate(text);
			} catch (TemplateException e) {
				fValidationStatus.setError(e.getLocalizedMessage());
			}
		}
		updateUndoAction();
		updateButtons();
	}	
	private static GridData getButtonGridData(Button button) {
		GridData data= new GridData(GridData.FILL_HORIZONTAL);
		data.heightHint= SWTUtil.getButtonHeightHint(button);
	
		return data;