Search in sources :

Example 1 with StructuredTextViewerConfigurationXSL

use of org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL in project webtools.sourceediting by eclipse.

the class ResultView method createViewer.

private SourceViewer createViewer(Composite parent) {
    SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {

        StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationXSL();

        @Override
        public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
            return baseConfiguration.getConfiguredContentTypes(sourceViewer);
        }

        @Override
        public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
            return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
        }
    };
    SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    // $NON-NLS-1$
    ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont"));
    viewer.configure(sourceViewerConfiguration);
    viewer.setEditable(false);
    return viewer;
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer) SourceViewer(org.eclipse.jface.text.source.SourceViewer) LineStyleProvider(org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider) StructuredTextViewerConfigurationXSL(org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL) StructuredTextViewerConfiguration(org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer) StructuredTextViewer(org.eclipse.wst.sse.ui.internal.StructuredTextViewer)

Example 2 with StructuredTextViewerConfigurationXSL

use of org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL in project webtools.sourceediting by eclipse.

the class NewXSLFileTemplatesWizardPage method createViewer.

private SourceViewer createViewer(Composite parent) {
    SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {

        StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationXSL();

        @Override
        public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
            return baseConfiguration.getConfiguredContentTypes(sourceViewer);
        }

        @Override
        public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
            return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
        }
    };
    SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    // $NON-NLS-1$
    viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont"));
    IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForXML.ContentTypeID_XML);
    IDocument document = scratchModel.getStructuredDocument();
    viewer.configure(sourceViewerConfiguration);
    viewer.setDocument(document);
    return viewer;
}
Also used : SourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer) SourceViewer(org.eclipse.jface.text.source.SourceViewer) LineStyleProvider(org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider) StructuredTextViewerConfigurationXSL(org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL) IStructuredModel(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel) StructuredTextViewerConfiguration(org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer) StructuredTextViewer(org.eclipse.wst.sse.ui.internal.StructuredTextViewer) IDocument(org.eclipse.jface.text.IDocument)

Example 3 with StructuredTextViewerConfigurationXSL

use of org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL in project webtools.sourceediting by eclipse.

the class AbstractSourceViewerTest method configureSourceViewer.

protected void configureSourceViewer() {
    sourceViewer.configure(new StructuredTextViewerConfigurationXSL());
    sourceViewer.setDocument(document);
}
Also used : StructuredTextViewerConfigurationXSL(org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL)

Aggregations

StructuredTextViewerConfigurationXSL (org.eclipse.wst.xsl.ui.internal.StructuredTextViewerConfigurationXSL)3 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)2 SourceViewer (org.eclipse.jface.text.source.SourceViewer)2 SourceViewerConfiguration (org.eclipse.jface.text.source.SourceViewerConfiguration)2 StructuredTextViewerConfiguration (org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration)2 StructuredTextViewer (org.eclipse.wst.sse.ui.internal.StructuredTextViewer)2 LineStyleProvider (org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)2 IDocument (org.eclipse.jface.text.IDocument)1 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)1