Search in sources :

Example 1 with GroovyPartitionScanner

use of eu.esdihumboldt.hale.ui.util.groovy.internal.GroovyPartitionScanner in project hale by halestudio.

the class GroovySourceViewerUtil method setupDocument.

/**
 * Setup a Groovy document.
 *
 * @param doc the document
 */
public static void setupDocument(IDocument doc) {
    IPartitionTokenScanner scanner = new GroovyPartitionScanner();
    IDocumentPartitioner partitioner = new FastPartitioner(scanner, GroovyPartitionScanner.LEGAL_CONTENT_TYPES);
    doc.setDocumentPartitioner(partitioner);
    partitioner.connect(doc);
}
Also used : IDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner) FastPartitioner(org.eclipse.jface.text.rules.FastPartitioner) IPartitionTokenScanner(org.eclipse.jface.text.rules.IPartitionTokenScanner) GroovyPartitionScanner(eu.esdihumboldt.hale.ui.util.groovy.internal.GroovyPartitionScanner)

Aggregations

GroovyPartitionScanner (eu.esdihumboldt.hale.ui.util.groovy.internal.GroovyPartitionScanner)1 IDocumentPartitioner (org.eclipse.jface.text.IDocumentPartitioner)1 FastPartitioner (org.eclipse.jface.text.rules.FastPartitioner)1 IPartitionTokenScanner (org.eclipse.jface.text.rules.IPartitionTokenScanner)1