Search in sources :

Example 1 with IDocumentPartitioningListenerExtension

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);
        }
    }
}
Also used : IDocumentPartitioningListenerExtension(org.eclipse.jface.text.IDocumentPartitioningListenerExtension) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) IStructuredDocumentRegionList(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList) ArrayList(java.util.ArrayList) IDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener) IDocumentPartitioningListenerExtension2(org.eclipse.jface.text.IDocumentPartitioningListenerExtension2)

Aggregations

ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 IDocumentPartitioningListener (org.eclipse.jface.text.IDocumentPartitioningListener)1 IDocumentPartitioningListenerExtension (org.eclipse.jface.text.IDocumentPartitioningListenerExtension)1 IDocumentPartitioningListenerExtension2 (org.eclipse.jface.text.IDocumentPartitioningListenerExtension2)1 IStructuredDocumentRegionList (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList)1