final IPreferenceStore store = topStore == null ? new ChainedPreferenceStore(
new IPreferenceStore[] { generalTextStore })
: new ChainedPreferenceStore(new IPreferenceStore[] { topStore,
generalTextStore });
final SourceViewer viewer = new SourceViewer(parent, null, null, false,
SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
final IDocument document = new Document(content);
viewer.setDocument(document);
final ErlangDocumentSetupParticipant setupParticipant = new ErlangDocumentSetupParticipant();
setupParticipant.setup(document);
final ErlangSourceViewerConfiguration configuration = new SyntaxColorPreviewEditorConfiguration(
store, colorManager, colors);
viewer.configure(configuration);
final Font font = JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
viewer.getTextWidget().setFont(font);
new ErlangSourceViewerUpdater(viewer, configuration, store);
viewer.setEditable(false);
final Cursor arrowCursor = viewer.getTextWidget().getDisplay()
.getSystemCursor(SWT.CURSOR_ARROW);
viewer.getTextWidget().setCursor(arrowCursor);
return viewer;
}