Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-04-16 13:56:14 -0400
committerMichael Valenta2002-04-16 13:56:14 -0400
commit89cd769e231597832f459e9fc545526383e0ddb9 (patch)
treee80ced777cc4245c5ab415ca8680adef1dddade2
parent0d6d6e958c408d1527e15c870d64568436d95dc3 (diff)
downloadeclipse.platform.team-89cd769e231597832f459e9fc545526383e0ddb9.tar.gz
eclipse.platform.team-89cd769e231597832f459e9fc545526383e0ddb9.tar.xz
eclipse.platform.team-89cd769e231597832f459e9fc545526383e0ddb9.zip
Added project configure/deconfigure notification to resource state
change notification
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java30
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java26
3 files changed, 60 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index e9429b1dd..8a559350b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -383,6 +383,36 @@ public class CVSProviderPlugin extends Plugin {
Platform.run(code);
}
}
+
+ protected static void broadcastProjectConfigured(final IProject project) {
+ for(Iterator it=listeners.iterator(); it.hasNext();) {
+ final IResourceStateChangeListener listener = (IResourceStateChangeListener)it.next();
+ ISafeRunnable code = new ISafeRunnable() {
+ public void run() throws Exception {
+ listener.projectConfigured(project);
+ }
+ public void handleException(Throwable e) {
+ // don't log the exception....it is already being logged in Platform#run
+ }
+ };
+ Platform.run(code);
+ }
+ }
+ protected static void broadcastProjectDeconfigured(final IProject project) {
+ for(Iterator it=listeners.iterator(); it.hasNext();) {
+ final IResourceStateChangeListener listener = (IResourceStateChangeListener)it.next();
+ ISafeRunnable code = new ISafeRunnable() {
+ public void run() throws Exception {
+ listener.projectDeconfigured(project);
+ }
+ public void handleException(Throwable e) {
+ // don't log the exception....it is already being logged in Platform#run
+ }
+ };
+ Platform.run(code);
+ }
+ }
+
/**
* Gets the showTasksOnAddAndDelete.
* @return Returns a boolean
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
index 582417875..17523f25a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
@@ -65,6 +65,7 @@ import org.eclipse.team.internal.ccvs.core.streams.LFtoCRLFInputStream;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
+import org.eclipse.team.internal.ccvs.core.util.AddDeleteMoveListener;
import org.eclipse.team.internal.ccvs.core.util.Assert;
import org.eclipse.team.internal.ccvs.core.util.PrepareForReplaceVisitor;
@@ -126,6 +127,8 @@ public class CVSTeamProvider extends RepositoryProvider {
EclipseSynchronizer.getInstance().flush(getProject(), true, true /*flush deep*/, null);
} catch(CVSException e) {
throw new CoreException(e.getStatus());
+ } finally {
+ CVSProviderPlugin.broadcastProjectDeconfigured(getProject());
}
}
@@ -921,6 +924,7 @@ public class CVSTeamProvider extends RepositoryProvider {
}
public void configureProject() throws CoreException {
+ CVSProviderPlugin.broadcastProjectConfigured(getProject());
}
/**
* Sets the keyword substitution mode for the specified resources.
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
index efa1802d6..a829c543a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
@@ -7,6 +7,7 @@ package org.eclipse.team.internal.ccvs.core;
import java.util.EventListener;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
/**
@@ -35,5 +36,30 @@ public interface IResourceStateChangeListener extends EventListener{
* resources new team state.]
*/
public void resourceStateChanged(IResource[] changedResources);
+
+ /**
+ * Notifies this listener that the project has just been configured
+ * to be a CVS project (i.e has the CVS nature).
+ * <p>
+ * Note: This method is called by team core; it is not intended to be called
+ * directly by clients.
+ * </p>
+ *
+ * @param project The project that has just been configured
+ */
+ public void projectConfigured(IProject project);
+
+ /**
+ * Notifies this listener that the project has just been deconfigured
+ * and no longer has the CVS nature.
+ * <p>
+ * Note: This method is called by team core; it is not intended to be called
+ * directly by clients.
+ * </p>
+ *
+ * @param project The project that has just been configured
+ */
+ public void projectDeconfigured(IProject project);
+
}

Back to the top