// GridData.FILL_VERTICAL);
// data.horizontalSpan= nColumns;
// data.heightHint= fPixelConverter.convertHeightInCharsToPixels(5);
// control.setLayoutData(data);
StructuredTextViewer viewer = new StructuredTextViewer(parent, null,
null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL
| SWT.READ_ONLY);
IStructuredDocument document = StructuredModelManager.getModelManager()
.createStructuredDocumentFor(
ContentTypeIdForPHP.ContentTypeID_PHP);
StyledText text = viewer.getTextWidget();
text.setLayoutData(data);
text.setEditable(false);
text.setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
// PHPStructuredTextViewerConfiguration configuration = new
// PHPStructuredTextViewerConfiguration();
SourceViewerConfiguration configuration = new StructuredTextViewerConfiguration() {
StructuredTextViewerConfiguration baseConfiguration = new PHPStructuredTextViewerConfiguration();
@Override
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return baseConfiguration
.getConfiguredContentTypes(sourceViewer);
}
@Override
public LineStyleProvider[] getLineStyleProviders(
ISourceViewer sourceViewer, String partitionType) {
return baseConfiguration.getLineStyleProviders(sourceViewer,
partitionType);
}
};
viewer.configure(configuration);
viewer.setEditable(false);
viewer.setDocument(document);
Control control = viewer.getControl();
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
| GridData.FILL_VERTICAL);
data.horizontalSpan = nColumns;
data.heightHint = fPixelConverter.convertHeightInCharsToPixels(5);
control.setLayoutData(data);