Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-03-05 12:43:47 -0500
committerJean Michel-Lemieux2002-03-05 12:43:47 -0500
commit349ca75ceb0889162c260669a4fa16aa897fe6df (patch)
tree58f4b4f722d66aab078e672f3f733a9a02a6c6ed
parent91d3f685f96dd52ee92f5dc37d5dd93b24555655 (diff)
downloadeclipse.platform.team-349ca75ceb0889162c260669a4fa16aa897fe6df.tar.gz
eclipse.platform.team-349ca75ceb0889162c260669a4fa16aa897fe6df.tar.xz
eclipse.platform.team-349ca75ceb0889162c260669a4fa16aa897fe6df.zip
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
index 63a3b87ad..faf85c07b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
@@ -8,13 +8,14 @@ package org.eclipse.team.internal.ccvs.ui;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
@@ -22,6 +23,7 @@ import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.LabelProvider;
@@ -56,8 +58,18 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
private static CVSDecorator theDecorator = null;
- // Resources that need an icon and text computed for display to the user, no order
- private Set decoratorNeedsUpdating = Collections.synchronizedSet(new HashSet());
+ // Resources that need an icon and text computed for display to the user, sorted by canonical path
+ private SortedSet decoratorNeedsUpdating = Collections.synchronizedSortedSet(
+ new TreeSet(new Comparator() {
+ public boolean equals(Object a, Object b) {
+ return a == b || a.equals(b);
+ }
+ public int compare(Object a, Object b) {
+ IPath pathA = ((IResource) a).getFullPath();
+ IPath pathB = ((IResource) b).getFullPath();
+ return pathA.toString().compareTo(pathB.toString());
+ }
+ }));
// When decorations are computed they are added to this cache via decorated() method
private Map cache = Collections.synchronizedMap(new HashMap());
@@ -179,9 +191,8 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
// The decorator was awakened by the plug-in as it was shutting down.
return null;
}
- Iterator iterator = decoratorNeedsUpdating.iterator();
- IResource resource = (IResource) iterator.next();
- iterator.remove();
+ IResource resource = (IResource) decoratorNeedsUpdating.first();
+ decoratorNeedsUpdating.remove(resource);
//System.out.println("++ Next: " + resource.getFullPath() + " remaining in cache: " + cache.size());

Back to the top