SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	private SourceViewer createEditor(Composite parent) {		SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);		IDocument document= new Document(fTemplate.getPattern());		JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();		tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);		IPreferenceStore newStore= new ChainedPreferenceStore(new IPreferenceStore[] { tools.getPreferenceStore(), new PreferencesAdapter(tools.getCorePreferenceStore()) });		TemplateEditorSourceViewerConfiguration configuration= new TemplateEditorSourceViewerConfiguration(tools.getColorManager(), newStore, null, fTemplateProcessor);		viewer.configure(configuration);		viewer.setEditable(true);		viewer.setDocument(document);				Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);		viewer.getTextWidget().setFont(font);		new JavaSourcePreviewerUpdater(viewer, configuration, newStore);				int nLines= document.getNumberOfLines();		if (nLines < 5) {			nLines= 5;		} else if (nLines > 12) {			nLines= 12;			}						Control control= viewer.getControl();		GridData data= new GridData(GridData.FILL_BOTH);		data.widthHint= convertWidthInCharsToPixels(80);		data.heightHint= convertHeightInCharsToPixels(nLines);		control.setLayoutData(data);				viewer.addTextListener(new ITextListener() {			public void textChanged(TextEvent event) {				if (event .getDocumentEvent() != null)					doSourceChanged(event.getDocumentEvent().getDocument());			}		});		viewer.addSelectionChangedListener(new ISelectionChangedListener() {						public void selectionChanged(SelectionChangedEvent event) {				updateSelectionDependentActions();			}		});		viewer.prependVerifyKeyListener(new VerifyKeyListener() {			public void verifyKey(VerifyEvent event) {				handleVerifyKeyPressed(event);			}		});				return viewer;	}