diff options
author | Michael Valenta | 2002-06-11 21:25:12 +0000 |
---|---|---|
committer | Michael Valenta | 2002-06-11 21:25:12 +0000 |
commit | 67cf7cf23d678417a1c72f51d4bbf03622804866 (patch) | |
tree | 7f474601fe5b28cb3f38cefc934fc274f66fa97e | |
parent | 4471a1b806a370ae20e5bd74607f0977c6477c23 (diff) | |
download | eclipse.platform.team-67cf7cf23d678417a1c72f51d4bbf03622804866.tar.gz eclipse.platform.team-67cf7cf23d678417a1c72f51d4bbf03622804866.tar.xz eclipse.platform.team-67cf7cf23d678417a1c72f51d4bbf03622804866.zip |
19853: Should clear out decorators when RepositoryProvider.deconfigure()
2 files changed, 21 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java index f459d6739..4ce371488 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java @@ -106,7 +106,9 @@ public class CVSDecorationRunnable implements Runnable { CVSDecoration decoration; try { - decoration = decorate(resource); + decoration = CVSDecorator.getActiveCVSDecorator().isMemberDeconfiguredProject(resource) + ? null + : decorate(resource); } catch (Exception e) { // If there was a problem, log it and set the decoration to null CVSUIPlugin.log(new Status(IStatus.ERROR, CVSUIPlugin.ID, 0, Policy.bind("simpleInternal"), e)); 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 3f63cecfd..9f304a14e 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 @@ -111,7 +111,7 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes * Return the CVSDecorator instance that is currently enabled. * Return null if we don't have a decorator or its not enabled. */ - private static CVSDecorator getActiveCVSDecorator() { + /* package */ static CVSDecorator getActiveCVSDecorator() { IDecoratorManager manager = CVSUIPlugin.getPlugin().getWorkbench().getDecoratorManager(); if (manager.getEnabled(CVSUIPlugin.DECORATOR_ID)) return (CVSDecorator) manager.getLabelDecorator(CVSUIPlugin.DECORATOR_ID); @@ -269,13 +269,14 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes } if (resource.getType() == IResource.PROJECT) { - // If there is no CVS nature, don't continue + // deconfigure if appropriate (see CVSDecorator#projectDeconfigured(IProject)) + // do this even if there is a provider (this is required since old projects may still have a cvs nature) + if (deconfiguredProjects.contains(resource)) { + deconfiguredProjects.remove(resource); + refresh((IProject)resource); + } + // If there is no CVS provider, don't continue if (RepositoryProvider.getProvider((IProject)resource, CVSProviderPlugin.getTypeId()) == null) { - // deconfigure if appropriate (see CVSDecorator#projectDeconfigured(IProject)) - if (deconfiguredProjects.contains(resource)) { - refresh((IProject)resource); - deconfiguredProjects.remove(resource); - } return false; } } @@ -512,4 +513,14 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes } return false; } + /** + * This method is used to indicate whether a particular resource is a member of + * a project that is in the process of being deconfigured. Such resources should not + * be decorated. + */ + /* package */ boolean isMemberDeconfiguredProject(IResource resource) { + if (deconfiguredProjects.isEmpty()) return false; + return deconfiguredProjects.contains(resource.getProject()); + } + }
\ No newline at end of file |