Search in sources :

Example 71 with IDocumentPartitioner

use of org.eclipse.jface.text.IDocumentPartitioner in project statecharts by Yakindu.

the class StyledTextXtextAdapter method initXtextDocument.

protected void initXtextDocument(XtextFakeResourceContext context) {
    getXtextDocument().setInput(context.getFakeResource());
    IDocumentPartitioner partitioner = getDocumentPartitioner().get();
    partitioner.connect(getXtextDocument());
    getXtextDocument().setDocumentPartitioner(partitioner);
}
Also used : IDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)

Example 72 with IDocumentPartitioner

use of org.eclipse.jface.text.IDocumentPartitioner in project erlide_eclipse by erlang.

the class ErlangDocumentSetupParticipant method setupErlangDocumentPartitioner.

public void setupErlangDocumentPartitioner(final IDocument document, final String partitioning) {
    final IDocumentPartitioner partitioner = ErlangDocumentSetupParticipant.createDocumentPartitioner();
    if (document instanceof IDocumentExtension3) {
        final IDocumentExtension3 extension3 = (IDocumentExtension3) document;
        extension3.setDocumentPartitioner(partitioning, partitioner);
    } else {
        document.setDocumentPartitioner(partitioner);
    }
    partitioner.connect(document);
}
Also used : IDocumentExtension3(org.eclipse.jface.text.IDocumentExtension3) IDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)

Aggregations

IDocumentPartitioner (org.eclipse.jface.text.IDocumentPartitioner)72 IDocument (org.eclipse.jface.text.IDocument)27 IDocumentExtension3 (org.eclipse.jface.text.IDocumentExtension3)27 FastPartitioner (org.eclipse.jface.text.rules.FastPartitioner)25 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)12 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)9 IFile (org.eclipse.core.resources.IFile)7 IModelManager (org.eclipse.wst.sse.core.internal.provisional.IModelManager)7 IStructuredTextPartitioner (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner)6 BadLocationException (org.eclipse.jface.text.BadLocationException)5 ITypedRegion (org.eclipse.jface.text.ITypedRegion)5 DocumentEvent (org.eclipse.jface.text.DocumentEvent)4 IDocumentListener (org.eclipse.jface.text.IDocumentListener)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 ITextFileBuffer (org.eclipse.core.filebuffers.ITextFileBuffer)3 IPath (org.eclipse.core.runtime.IPath)3 XtextDocument (org.eclipse.xtext.ui.editor.model.XtextDocument)3 SQLDocument (com.cubrid.common.ui.query.editor.SQLDocument)2 SQLPartitionScanner (com.cubrid.common.ui.query.editor.SQLPartitionScanner)2