1 4 package org.oddjob.designer.model; 5 6 9 abstract public class DEObservable { 10 11 abstract public void update(DEObserver observer); 12 13 public static DEObservable childAdded(final DesignElement child, final int index) { 14 return new DEObservable() { 15 public void update(DEObserver observer) { 16 observer.childAdded(child, index); 17 } 18 }; 19 } 20 21 public static DEObservable childRemoved(final DesignElement child, final int index) { 22 return new DEObservable() { 23 public void update(DEObserver observer) { 24 observer.childRemoved(child, index); 25 } 26 }; 27 28 } 29 30 public static DEObservable childChanged(final DEObservable observable) { 31 return new DEObservable() { 32 public void update(DEObserver observer) { 33 observer.childChanged(observable); 34 } 35 }; 36 } 37 38 public static DEObservable attributeChanged(final String attribute) { 39 return new DEObservable() { 40 public void update(DEObserver observer) { 41 observer.attributeChanged(attribute); 42 } 43 }; 44 45 } 46 47 public static DEObservable detailChanged(final Object detail) { 48 return new DEObservable() { 49 public void update(DEObserver observer) { 50 observer.datailChanged(detail); 51 } 52 }; 53 54 } 55 } 56 | Popular Tags |