Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-14 15:10:52 +0000
committerMichael Valenta2002-06-14 15:10:52 +0000
commite142341f5eb34cc86c942786bbc9f69a3deb2860 (patch)
tree5bdbed29fa49511ef93c84d73fb2512663b432ad
parent05d6b610835949b0a17819487e60615ffd9b96e7 (diff)
downloadeclipse.platform.team-e142341f5eb34cc86c942786bbc9f69a3deb2860.tar.gz
eclipse.platform.team-e142341f5eb34cc86c942786bbc9f69a3deb2860.tar.xz
eclipse.platform.team-e142341f5eb34cc86c942786bbc9f69a3deb2860.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/IRepositoryMappingListener.java17
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java15
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml3
4 files changed, 31 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IRepositoryMappingListener.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IRepositoryMappingListener.java
index 08df914b4..703429031 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IRepositoryMappingListener.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IRepositoryMappingListener.java
@@ -16,6 +16,23 @@ import org.eclipse.core.resources.IProject;
* Instances of this interface can be registered with the repositoryMappingNotification
* extension point to receive notification when a repository provider is mapped/unmapped
* to/from a project.
+ * <p>
+ * Instances are registered with Team by placing the following snippet in their plugin.xml,
+ * where <code>RepositoryMappingListener</code> is a class that implements IRepositoryMappingListener.
+ * </p>
+ *
+ * <code>
+ * &lt;extension
+ * point="org.eclipse.team.core.repositoryMappingNotification"&gt;
+ * &lt;repository
+ * class="org.eclipse.component.RepositoryMappingListener"&gt;
+ * &lt;/repository&gt;
+ * &lt;/extension&gt;
+ * </code>
+ *
+ * @see RepositoryProvider
+ *
+ * @since 2.0
*/
public interface IRepositoryMappingListener {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
index 6247f5727..983fd5260 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java
@@ -152,15 +152,24 @@ public abstract class RepositoryProvider implements IProjectNature {
*/
public static void unmap(IProject project) throws TeamException {
try{
- boolean hasProviderAssociated = project.getPersistentProperty(PROVIDER_PROP_KEY) != null;
+ String id = project.getPersistentProperty(PROVIDER_PROP_KEY);
//If you tried to remove a non-existance nature it would fail, so we need to as well with the persistent prop
- if(! hasProviderAssociated)
+ if(id == null)
throw new TeamException(Policy.bind("RepositoryProvider.No_Provider_Registered", project.getName())); //$NON-NLS-1$
//This will instantiate one if it didn't already exist,
//which is ok since we need to call deconfigure() on it for proper lifecycle
- getProvider(project).deconfigure();
+ RepositoryProvider provider = getProvider(project);
+ if (provider == null) {
+ // There is a persistant property but the provider cannot be obtained.
+ // The reason could be that the provider's plugin is no longer available.
+ // Better log it just in case this is unexpected.
+ TeamPlugin.log(new Status(IStatus.ERROR, TeamPlugin.ID, 0,
+ Policy.bind("RepositoryProvider.couldNotInstantiateProvider", id), null));
+ } else {
+ provider.deconfigure();
+ }
project.setSessionProperty(PROVIDER_PROP_KEY, null);
project.setPersistentProperty(PROVIDER_PROP_KEY, null);
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
index 556023450..73678e030 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
@@ -32,6 +32,7 @@ RepositoryProvider_providerTypeIdNotRegistered=Error configuring the RepositoryP
RepositoryProvider.couldNotInstantiateProvider=Could not instantiate provider {1} for project {0}.
RepositoryProvider.No_Provider_Registered=No provider registered for {0}.
RepositoryProvider.propertyMismatch=Inconsistent session/persistent property state looking up provider {1}.
+RepositoryProvider.couldNotInstantiateProvider=Could not instantiate provider with ID ''{0}''.
TeamPlugin_setting_global_ignore_7=setting global ignore
TeamPlugin_renaming_21=renaming
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index d1e93f35c..c00c3e790 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -705,8 +705,7 @@
<extension
point="org.eclipse.team.core.repositoryMappingNotification">
<repository
- class="org.eclipse.team.internal.ccvs.ui.RepositoryMappingListener"
- id="org.eclipse.team.cvs.ui.repositoryMappingListener">
+ class="org.eclipse.team.internal.ccvs.ui.RepositoryMappingListener">
</repository>
</extension>
</plugin>

Back to the top