use of org.eclipse.jface.text.rules.FastPartitioner 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);
}
use of org.eclipse.jface.text.rules.FastPartitioner 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;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project linuxtools by eclipse.
the class SuppressionsDocumentProvider method getDocument.
@Override
public IDocument getDocument(Object element) {
IDocument document = super.getDocument(element);
if (document != null) {
FastPartitioner partitioner = new FastPartitioner(new RuleBasedPartitionScanner(), SuppressionsPartitionScanner.SUPP_CONTENT_TYPES);
partitioner.connect(document, false);
if (document.getDocumentPartitioner() == null) {
document.setDocumentPartitioner(partitioner);
}
}
return document;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project tmdm-studio-se by Talend.
the class XMLDocumentProvider method createDocument.
// XMLEditor editor;
// public XMLDocumentProvider(XMLEditor editor){
// this.editor=editor;
// }
protected IDocument createDocument(Object element) throws CoreException {
if (element instanceof XMLEditorInput) {
// IDocument document = super.createDocument(element);
IDocument document = ((XMLEditorInput) element).getDocument();
if (document != null) {
IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] { XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
return null;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project tmdm-studio-se by Talend.
the class ElementFKInfoFormatViewer method intallDocument.
private void intallDocument(IDocument doc) {
IDocumentPartitioner partitioner = new FastPartitioner(new ElementFKInfotPartitionScanner(), new String[] { ElementFKInfotPartitionScanner.COMMON_STRING });
partitioner.connect(doc);
doc.setDocumentPartitioner(partitioner);
setDocument(doc, annotationModel);
}
Aggregations