Java Code Examples for org.eclipse.jface.text.presentation.PresentationReconciler#setDocumentPartitioning()

The following examples show how to use org.eclipse.jface.text.presentation.PresentationReconciler#setDocumentPartitioning() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextUMLSourceViewerConfiguration.java    From textuml with Eclipse Public License 1.0 6 votes vote down vote up
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    final PresentationReconciler reconciler = new PresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
    final SyntaxHighlighter scanner = new SyntaxHighlighter(
            com.abstratt.mdd.frontend.textuml.core.TextUMLConstants.KEYWORDS);
    final DefaultDamagerRepairer dr = new DefaultDamagerRepairer(scanner);
    reconciler.setDamager(dr, ContentTypes.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, ContentTypes.DEFAULT_CONTENT_TYPE);

    // fix bug 2127735 --multiline comment is broken
    final ITokenScanner commentScanner = scanner.getCommentScanner();
    final DefaultDamagerRepairer commentDamagerRepairer = new DefaultDamagerRepairer(commentScanner);
    reconciler.setDamager(commentDamagerRepairer, ContentTypes.COMMENT_CONTENT_TYPE);
    reconciler.setRepairer(commentDamagerRepairer, ContentTypes.COMMENT_CONTENT_TYPE);

    return reconciler;
}
 
Example 2
Source File: CommonSourceViewerConfiguration.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer)
{
	if (disableBackgroundReconciler)
	{
		return super.getPresentationReconciler(sourceViewer);
	}
	else
	{
		PresentationReconciler reconciler = new CommonPresentationReconciler();
		reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
		return reconciler;
	}
}
 
Example 3
Source File: AbstractSimpleLangSourceViewerConfiguration.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
	PresentationReconciler reconciler = createPresentationReconciler();
	reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
	setupPresentationReconciler(reconciler, sourceViewer);
	return reconciler;
}
 
Example 4
Source File: AbstractLangBasicSourceViewerConfiguration.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
	PresentationReconciler reconciler = createPresentationReconciler();
	reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
	setupPresentationReconciler(reconciler, sourceViewer);
	return reconciler;
}