public interface IDocumentExtension
IDocument
.It introduces the notion of sequentially rewriting a document. This is to tell a document that a sequence of non-overlapping replace operation is about to be performed. Implementers can use this knowledge for internal optimization.
Is also introduces the concept of post notification replaces. This is, a document listener who is informed about a document change can cause a derived document change. As the listener is not allowed to directly modify the document, it can register a replace operation that is performed directly after all document listeners have been notified.
Modifier and Type | Interface and Description |
---|---|
static interface |
IDocumentExtension.IReplace
Interface for a post notification replace operation.
|
Modifier and Type | Method and Description |
---|---|
void |
registerPostNotificationReplace(IDocumentListener owner,
IDocumentExtension.IReplace replace)
Callback for document listeners to be used inside
documentChanged
to register a post notification replace operation on the document notifying them. |
void |
resumePostNotificationProcessing()
Resumes the processing of post notification replace operations.
|
void |
startSequentialRewrite(boolean normalize)
Deprecated.
since 3.1. Use
IDocumentExtension4.startRewriteSession(DocumentRewriteSessionType) instead. |
void |
stopPostNotificationProcessing()
Stops the processing of registered post notification replace operations until
resumePostNotificationProcessing is called. |
void |
stopSequentialRewrite()
Deprecated.
since 3.1. Use
IDocumentExtension4.stopRewriteSession(DocumentRewriteSession) instead. |
void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) throws UnsupportedOperationException
documentChanged
to register a post notification replace operation on the document notifying them.owner
- the owner of the replace operationreplace
- the replace operation to be executedUnsupportedOperationException
- if registerPostNotificationReplace
is not supported by this documentvoid stopPostNotificationProcessing()
resumePostNotificationProcessing
is called.void resumePostNotificationProcessing()
IDocumentExtension.IReplace
objects is not empty, they are immediately processed if the
document is not inside a replace operation. If the document is inside a replace operation,
they are processed directly after the replace operation has finished.void startSequentialRewrite(boolean normalize)
IDocumentExtension4.startRewriteSession(DocumentRewriteSessionType)
instead.normalize
flag indicates whether the rewrite is performed from
the start of the document to its end or from an arbitrary start offset.
The document is considered being in sequential rewrite mode as long as
stopSequentialRewrite
has not been called.
normalize
- true
if performed from the start to the end of the documentvoid stopSequentialRewrite()
IDocumentExtension4.stopRewriteSession(DocumentRewriteSession)
instead.startSequentialRewrite
has been called before.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.