Search in sources :

Example 1 with SpecfilePartitionScanner

use of org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfilePartitionScanner in project linuxtools by eclipse.

the class SpecfileDocumentProvider method getDocument.

@Override
public IDocument getDocument(Object element) {
    IDocument document = super.getDocument(element);
    if (document != null && document.getDocumentPartitioner() == null) {
        FastPartitioner partitioner = new FastPartitioner(new SpecfilePartitionScanner(), SpecfilePartitionScanner.SPEC_PARTITION_TYPES);
        partitioner.connect(document, false);
        document.setDocumentPartitioner(partitioner);
    }
    return document;
}
Also used : FastPartitioner(org.eclipse.jface.text.rules.FastPartitioner) SpecfilePartitionScanner(org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfilePartitionScanner) IDocument(org.eclipse.jface.text.IDocument)

Aggregations

IDocument (org.eclipse.jface.text.IDocument)1 FastPartitioner (org.eclipse.jface.text.rules.FastPartitioner)1 SpecfilePartitionScanner (org.eclipse.linuxtools.internal.rpm.ui.editor.scanners.SpecfilePartitionScanner)1