summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-08-06 09:00:32 (EDT)
committer Chris Aniszczyk2010-08-08 14:59:50 (EDT)
commit74510d09b9c5b18f4f7e273941d305d7f1ced95e (patch)
treed899324e5d0468a7264f57050eed587b879ff45d
parentf953f270cd2fee0c83dd9486e457a8ee340392a6 (diff)
downloadegit-74510d09b9c5b18f4f7e273941d305d7f1ced95e.zip
egit-74510d09b9c5b18f4f7e273941d305d7f1ced95e.tar.gz
egit-74510d09b9c5b18f4f7e273941d305d7f1ced95e.tar.bz2
Improve decorator performancerefs/changes/53/1253/2
Abort decoration process early if resource is ignored. Change-Id: I2dad9faa9e90588fd9fc266edd5a5e81bea4ba60 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
index bd6e899..35ba7e7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
@@ -63,6 +63,7 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.core.Team;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.TeamUI;
@@ -183,6 +184,7 @@ public class GitLightweightDecorator extends LabelProvider implements
* org.eclipse.jface.viewers.IDecoration)
*/
public void decorate(Object element, IDecoration decoration) {
+
final IResource resource = getResource(element);
if (resource == null)
return;
@@ -203,7 +205,9 @@ public class GitLightweightDecorator extends LabelProvider implements
// Don't decorate non-existing resources
if (!resource.exists() && !resource.isPhantom())
return;
-
+ // Don't decorate ignored resources (e.g. bin folder content)
+ if (Team.isIgnoredHint(resource))
+ return;
// Make sure we're dealing with a project under Git revision control
final RepositoryMapping mapping = RepositoryMapping
.getMapping(resource);