Search in sources :

Example 6 with StructuredTextViewerConfigurationXML

use of org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML in project webtools.sourceediting by eclipse.

the class TestViewerConfigurationXML method setUpViewerConfiguration.

private void setUpViewerConfiguration() {
    // some test environments might not have a "real" display
    if (Display.getCurrent() != null) {
        Shell shell = null;
        Composite parent = null;
        if (PlatformUI.isWorkbenchRunning()) {
            shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        } else {
            shell = new Shell(Display.getCurrent());
        }
        parent = new Composite(shell, SWT.NONE);
        // dummy viewer
        fViewer = new StructuredTextViewer(parent, null, null, false, SWT.NONE);
        fConfig = new StructuredTextViewerConfigurationXML();
    } else {
        fDisplayExists = false;
        Logger.log(Logger.INFO, "Remember, viewer configuration tests are not run because workbench is not open (normal on build machine)");
    }
}
Also used : StructuredTextViewerConfigurationXML(org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML) Shell(org.eclipse.swt.widgets.Shell) Composite(org.eclipse.swt.widgets.Composite) StructuredTextViewer(org.eclipse.wst.sse.ui.internal.StructuredTextViewer)

Aggregations

StructuredTextViewerConfigurationXML (org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML)6 StructuredTextViewer (org.eclipse.wst.sse.ui.internal.StructuredTextViewer)3 IDocument (org.eclipse.jface.text.IDocument)2 Method (java.lang.reflect.Method)1 IContributionManager (org.eclipse.jface.action.IContributionManager)1 ContentAssistant (org.eclipse.jface.text.contentassist.ContentAssistant)1 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)1 IContentAssistProcessor (org.eclipse.jface.text.contentassist.IContentAssistProcessor)1 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)1 SourceViewer (org.eclipse.jface.text.source.SourceViewer)1 SourceViewerConfiguration (org.eclipse.jface.text.source.SourceViewerConfiguration)1 Composite (org.eclipse.swt.widgets.Composite)1 Shell (org.eclipse.swt.widgets.Shell)1 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)1 StructuredTextViewerConfiguration (org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration)1 LineStyleProvider (org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)1