A document partitioner divides a document into a set of disjoint text partitions. Each partition has a content type, an offset, and a length. The document partitioner is connected to one document and informed about all changes of this document before any of the document's document listeners. A document partitioner can thus incrementally update on the receipt of a document change event.
In order to provided backward compatibility for clients of IDocumentPartitioner
, extension interfaces are used to provide a means of evolution. The following extension interfaces exist:
- {@link org.eclipse.jface.text.IDocumentPartitionerExtension} since version 2.0 replacingthe
documentChanged
method with a new one returning the minimal document region comprising all partition changes. - {@link org.eclipse.jface.text.IDocumentPartitionerExtension2} since version 3.0introducing zero-length partitions in conjunction with the distinction between open and closed partitions. Also provides inside in the implementation of the partitioner by exposing the position category used for managing the partitioning information.
- {@link org.eclipse.jface.text.IDocumentPartitionerExtension3} since version 3.1 introducingrewrite session. It also replaces the existing {@link #connect(IDocument)} method witha new one: {@link org.eclipse.jface.text.IDocumentPartitionerExtension3#connect(IDocument,boolean)}.
Clients may implement this interface and its extension interfaces or use the standard implementation DefaultPartitioner
.
@see org.eclipse.jface.text.IDocumentPartitionerExtension
@see org.eclipse.jface.text.IDocumentPartitionerExtension2
@see org.eclipse.jface.text.IDocument