Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 122613 Details for
Bug 194734
[Databinding] Property-based observables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Possible further refinement
clipboard.txt (text/plain), 5.15 KB, created by
Matthew Hall
on 2009-01-14 19:55:19 EST
(
hide
)
Description:
Possible further refinement
Filename:
MIME Type:
Creator:
Matthew Hall
Created:
2009-01-14 19:55:19 EST
Size:
5.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.databinding >Index: src/org/eclipse/core/databinding/property/set/SimpleSetPropertyObservableSet.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/set/Attic/SimpleSetPropertyObservableSet.java,v >retrieving revision 1.1.2.5 >diff -u -r1.1.2.5 SimpleSetPropertyObservableSet.java >--- src/org/eclipse/core/databinding/property/set/SimpleSetPropertyObservableSet.java 14 Jan 2009 23:51:10 -0000 1.1.2.5 >+++ src/org/eclipse/core/databinding/property/set/SimpleSetPropertyObservableSet.java 15 Jan 2009 00:54:27 -0000 >@@ -368,9 +368,16 @@ > private void notifyIfChanged(SetDiff diff) { > if (hasListeners()) { > Set oldSet = cachedSet; >- Set newSet = cachedSet = property.getSet(source); >- if (diff == null) >+ Set newSet; >+ if (diff == null) { >+ newSet = property.getSet(source); > diff = Diffs.computeSetDiff(oldSet, newSet); >+ } else { >+ newSet = new HashSet(oldSet); >+ diff.applyTo(newSet); >+ } >+ cachedSet = newSet; >+ > if (!diff.isEmpty()) > fireSetChange(diff); > } >Index: src/org/eclipse/core/databinding/property/value/SimpleValuePropertyObservableValue.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/value/Attic/SimpleValuePropertyObservableValue.java,v >retrieving revision 1.1.2.5 >diff -u -r1.1.2.5 SimpleValuePropertyObservableValue.java >--- src/org/eclipse/core/databinding/property/value/SimpleValuePropertyObservableValue.java 14 Jan 2009 23:51:10 -0000 1.1.2.5 >+++ src/org/eclipse/core/databinding/property/value/SimpleValuePropertyObservableValue.java 15 Jan 2009 00:54:27 -0000 >@@ -59,7 +59,7 @@ > if (!isDisposed() && !updating) { > getRealm().exec(new Runnable() { > public void run() { >- notifyIfChanged((ValueDiff) event.diff); >+ notifyIfChanged(); > } > }); > } >@@ -78,7 +78,7 @@ > } > > protected Object doGetValue() { >- notifyIfChanged(null); >+ notifyIfChanged(); > return property.getValue(source); > } > >@@ -90,18 +90,17 @@ > updating = false; > } > >- notifyIfChanged(null); >+ notifyIfChanged(); > } > >- private void notifyIfChanged(ValueDiff diff) { >+ private void notifyIfChanged() { > if (hasListeners()) { > Object oldValue = cachedValue; > Object newValue = cachedValue = property.getValue(source); >- if (diff == null) >- diff = Diffs.createValueDiff(oldValue, newValue); >- if (hasListeners() && !Util.equals(oldValue, newValue)) { >+ ValueDiff diff = Diffs.createValueDiff(oldValue, newValue); >+ >+ if (!Util.equals(oldValue, newValue)) > fireValueChange(diff); >- } > } > } > >Index: src/org/eclipse/core/databinding/property/list/SimpleListPropertyObservableList.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/list/Attic/SimpleListPropertyObservableList.java,v >retrieving revision 1.1.2.5 >diff -u -r1.1.2.5 SimpleListPropertyObservableList.java >--- src/org/eclipse/core/databinding/property/list/SimpleListPropertyObservableList.java 14 Jan 2009 23:51:10 -0000 1.1.2.5 >+++ src/org/eclipse/core/databinding/property/list/SimpleListPropertyObservableList.java 15 Jan 2009 00:54:27 -0000 >@@ -626,12 +626,18 @@ > private void notifyIfChanged(ListDiff diff) { > if (hasListeners()) { > List oldList = cachedList; >- List newList = cachedList = property.getList(source); >- if (diff == null) >+ List newList; >+ if (diff == null) { >+ newList = property.getList(source); > diff = Diffs.computeListDiff(oldList, newList); >- if (!diff.isEmpty()) { >- fireListChange(diff); >+ } else { >+ newList = new ArrayList(oldList); >+ diff.applyTo(newList); > } >+ cachedList = newList; >+ >+ if (!diff.isEmpty()) >+ fireListChange(diff); > } > } > >Index: src/org/eclipse/core/databinding/property/map/SimpleMapPropertyObservableMap.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/databinding/property/map/Attic/SimpleMapPropertyObservableMap.java,v >retrieving revision 1.1.2.5 >diff -u -r1.1.2.5 SimpleMapPropertyObservableMap.java >--- src/org/eclipse/core/databinding/property/map/SimpleMapPropertyObservableMap.java 14 Jan 2009 23:51:11 -0000 1.1.2.5 >+++ src/org/eclipse/core/databinding/property/map/SimpleMapPropertyObservableMap.java 15 Jan 2009 00:54:27 -0000 >@@ -267,9 +267,16 @@ > private void notifyIfChanged(MapDiff diff) { > if (hasListeners()) { > Map oldMap = cachedMap; >- Map newMap = cachedMap = property.getMap(source); >- if (diff == null) >+ Map newMap; >+ if (diff == null) { >+ newMap = property.getMap(source); > diff = Diffs.computeMapDiff(oldMap, newMap); >+ } else { >+ newMap = new HashMap(oldMap); >+ diff.applyTo(newMap); >+ } >+ cachedMap = newMap; >+ > if (!diff.isEmpty()) > fireMapChange(diff); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 194734
:
106529
|
107000
|
107001
|
107041
|
107042
|
111164
|
111165
|
111335
|
111336
|
111448
|
111449
|
111640
|
111641
|
111717
|
111719
|
111845
|
111846
|
111897
|
111898
|
111993
|
111994
|
112161
|
112162
|
112268
|
112269
|
112360
|
112361
|
112370
|
112371
|
112471
|
112472
|
112606
|
112607
|
112629
|
112630
|
113149
|
113150
|
113165
|
113166
|
114858
|
114859
|
115196
|
115197
|
115284
|
115458
|
115459
|
117500
|
117501
|
117990
|
117991
|
119231
|
119232
|
119274
|
120541
|
120542
|
120651
|
120652
|
120653
|
120654
|
120914
|
120915
|
120989
|
120990
|
121020
|
121021
|
121141
|
121142
|
122228
|
122229
|
122234
|
122235
|
122288
|
122289
|
122609
|
122610
| 122613 |
122614
|
122775
|
122776
|
122813
|
122814
|
122852
|
122853
|
122864
|
122865
|
123137
|
123138