|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Clients may implement this interface or use the standard
implementation RuleBasedDocumentPartitioner
.
IDocument
Method Summary | |
ITypedRegion[] |
computePartitioning(int offset,
int length)
Returns the partitioning of the given range of the connected document. |
void |
connect(IDocument document)
Connects the partitioner to a document. |
void |
disconnect()
Disconnects the partitioner from the document it is connected to. |
void |
documentAboutToBeChanged(DocumentEvent event)
Informs about a forthcoming document change. |
boolean |
documentChanged(DocumentEvent event)
The document has been changed. |
String |
getContentType(int offset)
Returns the content type of the partition containing the given offset in the connected document. |
String[] |
getLegalContentTypes()
Returns the set of all legal content types of this partitioner. |
ITypedRegion |
getPartition(int offset)
Returns the partition containing the given offset of the connected document. |
Method Detail |
public void connect(IDocument document)
The caller of this method must ensure that this partitioner is also set as the document's document partitioner.
document
- the document to be connected topublic void disconnect()
The caller of this method should also must ensure that this partitioner is no longer the document's partitioner.
public void documentAboutToBeChanged(DocumentEvent event)
event
- the event describing the forthcoming changepublic boolean documentChanged(DocumentEvent event)
event
- the event describing the document change
true
if partitioning changedpublic String[] getLegalContentTypes()
public String getContentType(int offset)
offset
- the offset in the connected document
public ITypedRegion[] computePartitioning(int offset, int length)
offset
- the offset of the range of interestlength
- the length of the range of interest
public ITypedRegion getPartition(int offset)
offset
- the offset for which to determine the partition
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |