use of org.eclipse.jface.text.DocumentPartitioningChangedEvent in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method stopRewriteSessionOnPartitioners.
/**
* Stops the given rewrite session.
*
* @param session the rewrite session
* @since 2.0
*/
final void stopRewriteSessionOnPartitioners(DocumentRewriteSession session) {
if (fDocumentPartitioners != null) {
DocumentPartitioningChangedEvent event = new DocumentPartitioningChangedEvent(this);
Iterator e = fDocumentPartitioners.keySet().iterator();
while (e.hasNext()) {
String partitioning = (String) e.next();
IDocumentPartitioner partitioner = (IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
if (partitioner instanceof IDocumentPartitionerExtension3) {
IDocumentPartitionerExtension3 extension = (IDocumentPartitionerExtension3) partitioner;
extension.stopRewriteSession(session);
event.setPartitionChange(partitioning, 0, getLength());
}
}
if (!event.isEmpty())
fireDocumentPartitioningChanged(event);
}
}
use of org.eclipse.jface.text.DocumentPartitioningChangedEvent in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method setDocumentPartitioner.
public void setDocumentPartitioner(String partitioning, IDocumentPartitioner partitioner) {
if (partitioner == null) {
if (fDocumentPartitioners != null) {
fDocumentPartitioners.remove(partitioning);
if (fDocumentPartitioners.size() == 0)
fDocumentPartitioners = null;
}
} else {
if (fDocumentPartitioners == null)
fDocumentPartitioners = new HashMap();
fDocumentPartitioners.put(partitioning, partitioner);
}
DocumentPartitioningChangedEvent event = new DocumentPartitioningChangedEvent(this);
event.setPartitionChange(partitioning, 0, getLength());
fireDocumentPartitioningChanged(event);
}
Aggregations