Search in sources :

Example 6 with JsonDocument

use of com.reprezen.swagedit.core.editor.JsonDocument in project KaiZen-OpenAPI-Editor by RepreZen.

the class JsonFileHyperlink method getTarget.

private IRegion getTarget() throws CoreException {
    JsonDocument doc = null;
    try {
        String content = DocumentUtils.getDocumentContent(file.getLocation());
        doc = createDocument();
        doc.set(content);
    } catch (IOException e) {
        return null;
    }
    return doc.getRegion(pointer);
}
Also used : IOException(java.io.IOException) JsonDocument(com.reprezen.swagedit.core.editor.JsonDocument)

Aggregations

JsonDocument (com.reprezen.swagedit.core.editor.JsonDocument)6 Model (com.reprezen.swagedit.core.model.Model)3 BadLocationException (org.eclipse.jface.text.BadLocationException)2 StyledString (org.eclipse.jface.viewers.StyledString)2 JsonPointer (com.fasterxml.jackson.core.JsonPointer)1 AbstractNode (com.reprezen.swagedit.core.model.AbstractNode)1 IOException (java.io.IOException)1 IDocument (org.eclipse.jface.text.IDocument)1 IRegion (org.eclipse.jface.text.IRegion)1 ITextSelection (org.eclipse.jface.text.ITextSelection)1 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)1 ContextTypeRegistry (org.eclipse.jface.text.templates.ContextTypeRegistry)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1