1 17 package org.eclipse.emf.edit.provider; 18 19 20 import java.util.ArrayList ; 21 import java.util.Iterator ; 22 23 import org.eclipse.emf.common.notify.Notification; 24 25 26 29 public class ChangeNotifier extends ArrayList implements IChangeNotifier 30 { 31 public ChangeNotifier() 32 { 33 } 34 35 38 public void fireNotifyChanged(Notification notification) 39 { 40 for (Iterator listeners = new ArrayList (this).iterator(); listeners.hasNext(); ) 41 { 42 INotifyChangedListener notifyChangedListener = (INotifyChangedListener)listeners.next(); 43 if (this.contains(notifyChangedListener)) 44 { 45 notifyChangedListener.notifyChanged(notification); 46 } 47 } 48 } 49 50 53 public void addListener(INotifyChangedListener notifyChangedListener) 54 { 55 add(notifyChangedListener); 56 } 57 58 61 public void removeListener(INotifyChangedListener notifyChangedListener) 62 { 63 remove(notifyChangedListener); 64 } 65 } 66 | Popular Tags |