Search in sources :

Example 1 with StructuredDocumentDamagerRepairer

use of org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer in project webtools.sourceediting by eclipse.

the class StructuredTextViewerConfiguration method getPresentationReconciler.

/**
 * See <code>getLineStyleProviders(ISourceViewer, String)</code> for
 * alternative way to provide highlighting information.
 *
 * @param sourceViewer
 *            the source viewer to be configured by this configuration
 * @return always returns null
 * @see #getLineStyleProviders(ISourceViewer, String)
 */
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    StructuredPresentationReconciler reconciler = new StructuredPresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    String[] contentTypes = getConfiguredContentTypes(sourceViewer);
    if (contentTypes != null) {
        StructuredDocumentDamagerRepairer dr = null;
        for (int i = 0; i < contentTypes.length; i++) {
            if (fHighlighter != null) {
                LineStyleProvider provider = fHighlighter.getProvider(contentTypes[i]);
                if (provider == null)
                    continue;
                dr = new StructuredDocumentDamagerRepairer(provider);
                dr.setDocument(sourceViewer.getDocument());
                reconciler.setDamager(dr, contentTypes[i]);
                reconciler.setRepairer(dr, contentTypes[i]);
            }
        }
    }
    return reconciler;
}
Also used : StructuredPresentationReconciler(org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler) StructuredDocumentDamagerRepairer(org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer) LineStyleProvider(org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)

Aggregations

LineStyleProvider (org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)1 StructuredPresentationReconciler (org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler)1 StructuredDocumentDamagerRepairer (org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer)1