}
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
DefaultDamagerRepairer dr = null;
if (apexCodeScanner != null) {
dr = new DefaultDamagerRepairer(apexCodeScanner);
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
}
if (apexDocScanner != null) {
dr = new DefaultDamagerRepairer(apexDocScanner);
reconciler.setDamager(dr, ApexPartitionScanner.APEX_DOC);
reconciler.setRepairer(dr, ApexPartitionScanner.APEX_DOC);
}
if (apexCodeColorProvider != null) {
dr =
new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(
apexCodeColorProvider.getColor(ApexCodeColorProvider.MULTI_LINE_COMMENT))));
reconciler.setDamager(dr, ApexPartitionScanner.APEX_MULTILINE_COMMENT);
reconciler.setRepairer(dr, ApexPartitionScanner.APEX_MULTILINE_COMMENT);
}
return reconciler;
}