use of org.eclipse.jface.text.rules.FastPartitioner in project cubrid-manager by CUBRID.
the class PropDocumentProvider method getDocument.
/**
* Retrieves the document to be edited.
*
* @param element Object
* @return IDocument
*/
public IDocument getDocument(Object element) {
IDocument document = null;
if (element instanceof IEditorInput) {
IEditorInput ei = ((IEditorInput) element);
DocumentProvider dp = (DocumentProvider) ei.getAdapter(DocumentProvider.class);
if (dp != null) {
document = dp.getDocument(element);
}
}
if (document == null) {
document = new Document();
}
IDocumentPartitioner partitioner = new FastPartitioner(new PropPartitionScanner(), PropPartitionScanner.LEGAL_CONTENT_TYPES);
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
return document;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project cubrid-manager by CUBRID.
the class XMLDocumentProvider method getDocument.
/**
* Retrieves the document to be edited.
*
* @param element Object
* @return IDocument
*/
public IDocument getDocument(Object element) {
IDocument document = null;
if (element instanceof IEditorInput) {
IEditorInput ei = ((IEditorInput) element);
DocumentProvider dp = (DocumentProvider) ei.getAdapter(DocumentProvider.class);
if (dp != null) {
document = dp.getDocument(element);
}
}
if (document == null) {
document = new Document();
}
IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] { XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
return document;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project eclipse.platform.text by eclipse.
the class XMLDocumentProvider method createDocument.
@Override
protected IDocument createDocument(Object element) throws CoreException {
IDocument document = super.createDocument(element);
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;
}
use of org.eclipse.jface.text.rules.FastPartitioner in project eclipse.platform.text by eclipse.
the class AbstractPairMatcherTest method createPartitioner.
private static IDocumentPartitioner createPartitioner() {
final RuleBasedPartitionScanner scan = new RuleBasedPartitionScanner();
final List<SingleLineRule> rules = new ArrayList<>();
rules.add(new SingleLineRule("|a", "a|", new Token("a")));
rules.add(new SingleLineRule("|b", "b|", new Token("b")));
rules.add(new SingleLineRule("|c", "c|", new Token("c")));
scan.setPredicateRules(rules.toArray(new IPredicateRule[rules.size()]));
scan.setDefaultReturnToken(new Token(DEFAULT_PARTITION));
return new FastPartitioner(scan, new String[] { DEFAULT_PARTITION, "a", "b", "c" });
}
use of org.eclipse.jface.text.rules.FastPartitioner in project linuxtools by eclipse.
the class DockerDocumentProvider method createDocument.
@Override
protected IDocument createDocument(Object element) throws CoreException {
IDocument document = super.createDocument(element);
if (document != null) {
DockerPartitionScanner scanner = new DockerPartitionScanner();
IDocumentPartitioner partitioner = new FastPartitioner(scanner, DockerPartitionScanner.ALLOWED_CONTENT_TYPES);
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
Aggregations