use of org.eclipse.jface.text.IDocumentPartitioningListenerExtension in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method fireDocumentPartitioningChanged.
/**
* Fires the document partitioning changed notification to all registered
* document partitioning listeners. Uses a robust iterator.
*
* @param event
* the document partitioning changed event
*
* @see IDocumentPartitioningListenerExtension2
*/
protected void fireDocumentPartitioningChanged(DocumentPartitioningChangedEvent event) {
if (fDocumentPartitioningListeners == null || fDocumentPartitioningListeners.size() == 0)
return;
List list = new ArrayList(fDocumentPartitioningListeners);
Iterator e = list.iterator();
while (e.hasNext()) {
IDocumentPartitioningListener l = (IDocumentPartitioningListener) e.next();
if (l instanceof IDocumentPartitioningListenerExtension2) {
IDocumentPartitioningListenerExtension2 extension2 = (IDocumentPartitioningListenerExtension2) l;
extension2.documentPartitioningChanged(event);
} else if (l instanceof IDocumentPartitioningListenerExtension) {
IDocumentPartitioningListenerExtension extension = (IDocumentPartitioningListenerExtension) l;
extension.documentPartitioningChanged(this, event.getCoverage());
} else {
l.documentPartitioningChanged(this);
}
}
}
Aggregations