Mercurial > projects > dwt2
diff org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.d @ 85:6be48cf9f95c
Work on databinding
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 13:54:50 +0200 |
parents | 383ce7bd736b |
children |
line wrap: on
line diff
--- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.d Sat Apr 18 09:25:29 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/UnionSet.d Sat Apr 18 13:54:50 2009 +0200 @@ -14,6 +14,7 @@ import org.eclipse.core.databinding.observable.set.ISetChangeListener; import org.eclipse.core.databinding.observable.set.SetChangeEvent; import org.eclipse.core.databinding.observable.set.IObservableSet; +import org.eclipse.core.databinding.observable.IObservable; import org.eclipse.core.databinding.observable.set.ObservableSet; import java.lang.all; @@ -66,18 +67,25 @@ */ public this(IObservableSet[] childSets) { super(childSets[0].getRealm(), null, childSets[0].getElementType()); - System.arraycopy(childSets, 0, this.childSets = new IObservableSet[childSets.length], 0, childSets.length); - this.stalenessTracker = new StalenessTracker(childSets, +childSetChangeListener = new ChildSetChangeListener(); +stalenessConsumer = new StalenessConsumer(); + this.childSets = new IObservableSet[childSets.length]; + for( int i = 0; i < childSets.length; i++ ){ + this.childSets[i] = childSets[i]; + } + this.stalenessTracker = new StalenessTracker(arraycast!(IObservable)(childSets), stalenessConsumer); } - private ISetChangeListener childSetChangeListener = new class() ISetChangeListener { + private ISetChangeListener childSetChangeListener; + class ChildSetChangeListener : ISetChangeListener { public void handleSetChange(SetChangeEvent event) { processAddsAndRemoves(event.diff.getAdditions(), event.diff.getRemovals()); } - }; + } - private IStalenessConsumer stalenessConsumer = new class() IStalenessConsumer { + private IStalenessConsumer stalenessConsumer; + class StalenessConsumer : IStalenessConsumer { public void setStale(bool stale) { bool oldStale = this.outer.stale; this.outer.stale = stale; @@ -85,7 +93,7 @@ fireStale(); } } - }; + } public bool isStale() { getterCalled(); @@ -154,7 +162,7 @@ next.addSetChangeListener(childSetChangeListener); incrementRefCounts(next); } - stalenessTracker = new StalenessTracker(childSets, stalenessConsumer); + stalenessTracker = new StalenessTracker(arraycast!(IObservable)(childSets), stalenessConsumer); setWrappedSet(refCounts.keySet()); }