use of org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPPartitionScanner in project linuxtools by eclipse.
the class STPFormattingTest method setupDocumentPartitioner.
/**
* Sets up the document partitioner for the given document for the given partitioning.
*
* @param document
* @param partitioning
* @param owner may be null
*/
private static void setupDocumentPartitioner(IDocument document, String partitioning) {
IDocumentPartitioner partitioner = new FastPartitioner(new STPPartitionScanner(), STPPartitionScanner.STP_PARTITION_TYPES);
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
extension3.setDocumentPartitioner(partitioning, partitioner);
} else {
document.setDocumentPartitioner(partitioner);
}
partitioner.connect(document);
}
Aggregations