Search in sources :

Example 1 with ColorManager

use of org.dadacoalition.yedit.editor.ColorManager in project KaiZen-OpenAPI-Editor by RepreZen.

the class JsonDocumentProvider method createDocument.

@Override
protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
        JsonScanner scanner = new JsonScanner(new ColorManager(), store);
        Set<String> tokens = YAMLToken.VALID_TOKENS.keySet();
        FastPartitioner partitioner = new FastPartitioner(scanner, tokens.toArray(new String[tokens.size()]));
        document.setDocumentPartitioner(partitioner);
        partitioner.connect(document);
    }
    return document;
}
Also used : FastPartitioner(org.eclipse.jface.text.rules.FastPartitioner) ColorManager(org.dadacoalition.yedit.editor.ColorManager) IDocument(org.eclipse.jface.text.IDocument)

Aggregations

ColorManager (org.dadacoalition.yedit.editor.ColorManager)1 IDocument (org.eclipse.jface.text.IDocument)1 FastPartitioner (org.eclipse.jface.text.rules.FastPartitioner)1