1 11 12 package org.eclipse.ant.internal.ui.editor.text; 13 14 15 import java.util.ArrayList ; 16 import java.util.Iterator ; 17 18 import org.eclipse.jface.text.reconciler.DirtyRegion; 19 import org.eclipse.jface.text.reconciler.IReconcilingStrategy; 20 import org.eclipse.jface.text.reconciler.MonoReconciler; 21 22 23 public class NotifyingReconciler extends MonoReconciler { 24 25 private ArrayList fReconcilingParticipants= new ArrayList (); 26 27 31 public NotifyingReconciler(IReconcilingStrategy strategy) { 32 super(strategy, false); 33 } 34 35 38 protected void process(DirtyRegion dirtyRegion) { 39 super.process(dirtyRegion); 40 notifyReconcilingParticipants(); 41 } 42 43 public void addReconcilingParticipant(IReconcilingParticipant participant) { 44 fReconcilingParticipants.add(participant); 45 } 46 47 public void removeReconcilingParticipant(IReconcilingParticipant participant) { 48 fReconcilingParticipants.remove(participant); 49 } 50 51 protected void notifyReconcilingParticipants() { 52 Iterator i= new ArrayList (fReconcilingParticipants).iterator(); 53 while (i.hasNext()) { 54 ((IReconcilingParticipant) i.next()).reconciled(); 55 } 56 } 57 60 protected void initialProcess() { 61 super.initialProcess(); 62 notifyReconcilingParticipants(); 63 } 64 } 65 | Popular Tags |