Package org.eclipse.jface.text
Interface IDocumentPartitionerExtension3
-
- All Known Implementing Classes:
DefaultPartitioner,FastPartitioner
public interface IDocumentPartitionerExtension3Extension interface forIDocumentPartitioner. Adds the concept of rewrite sessions. A rewrite session is a sequence of replace operations that form a semantic unit.- Since:
- 3.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconnect(IDocument document, boolean delayInitialization)Connects this partitioner to a document.DocumentRewriteSessiongetActiveRewriteSession()Returns the active rewrite session of this document ornull.voidstartRewriteSession(DocumentRewriteSession session)Tells the document partitioner that a rewrite session started.voidstopRewriteSession(DocumentRewriteSession session)Tells the document partitioner that the rewrite session has finished.
-
-
-
Method Detail
-
startRewriteSession
void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException
Tells the document partitioner that a rewrite session started. A rewrite session is a sequence of replace operations that form a semantic unit. The document partitioner is allowed to use that information for internal optimization.- Parameters:
session- the rewrite session- Throws:
IllegalStateException- in case there is already an active rewrite session
-
stopRewriteSession
void stopRewriteSession(DocumentRewriteSession session)
Tells the document partitioner that the rewrite session has finished. This method is only called whenstartRewriteSessionhas been called before.- Parameters:
session- the rewrite session
-
getActiveRewriteSession
DocumentRewriteSession getActiveRewriteSession()
Returns the active rewrite session of this document ornull.- Returns:
- the active rewrite session or
null
-
connect
void connect(IDocument document, boolean delayInitialization)
Connects this partitioner to a document. Connect indicates the begin of the usage of the receiver as partitioner of the given document. Thus, resources the partitioner needs to be operational for this document should be allocated.The caller of this method must ensure that this partitioner is also set as the document's document partitioner.
delayInitializationindicates whether the partitioner is allowed to delay it initial computation of the document's partitioning until it has to answer the first query. ReplacesIDocumentPartitioner.connect(IDocument).- Parameters:
document- the document to be connected todelayInitialization-trueif initialization can be delayed,falseotherwise
-
-