Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-03-15 16:09:58 +0000
committerJean Michel-Lemieux2002-03-15 16:09:58 +0000
commit353bd9c1cc818db771854515a0ef8641f08f3020 (patch)
tree7dd0e276ca8e9000b6e211675bf395751771d0ea
parenta36b51b9b25e3b85107079b3ad4772e0a5c22f92 (diff)
downloadeclipse.platform.team-353bd9c1cc818db771854515a0ef8641f08f3020.tar.gz
eclipse.platform.team-353bd9c1cc818db771854515a0ef8641f08f3020.tar.xz
eclipse.platform.team-353bd9c1cc818db771854515a0ef8641f08f3020.zip
- Made addProviderType package private
- added code to check that nature is registered as a provider type
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java18
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties5
3 files changed, 20 insertions, 5 deletions
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 5b1e25de4..11a301c4b 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
@@ -76,15 +76,25 @@ public abstract class RepositoryProvider implements IProjectNature {
count++;
}
}
- if(count>1) {
+ if(count==1) {
+ configureProject();
+ } else {
+ // FIXME: Must confirm with core how to correctly back-out/revert a nature application to a project
+ // remove this nature from the provider. I'm not sure
try {
TeamPlugin.removeNatureFromProject(getProject(), getProviderType().getID(), null);
} catch(TeamException e) {
throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_Error_removing_nature_from_project___1") + provider, null)); //$NON-NLS-1$
}
- throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_Too_many_providers_associated_with_project___2") + provider, null)); //$NON-NLS-1$
- }
- configureProject();
+ if(count>1) {
+ // another provider id is already associated with the project
+ throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_Too_many_providers_associated_with_project___2") + provider, null)); //$NON-NLS-1$
+ } else if(count==0) {
+ // although a subclass of RepositoryProvider is registered as a nature, the id has not been registered with
+ // the org.eclipse.team.core.repository-provider-type extension point.
+ throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_providerTypeIdNotRegistered") + provider, null)); //$NON-NLS-1$
+ }
+ }
}
/**
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java
index 1c865b34d..c9160441c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java
@@ -41,7 +41,7 @@ abstract public class RepositoryProviderType {
*
* @throws TeamException if the provider type is already registered.
*/
- final public static void addProviderType(RepositoryProviderType providerType) throws TeamException {
+ /*package*/ final static void addProviderType(RepositoryProviderType providerType) throws TeamException {
if(providerTypes.containsKey(providerType.getID())) {
throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProviderTypeduplicate_provider_found_in_plugin.xml___1") + providerType.getID(), null)); //$NON-NLS-1$
} else {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
index 47cd4dfee..61e92c662 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/messages.properties
@@ -25,7 +25,12 @@ RepositoryProvider_Too_many_providers_associated_with_project___2=Too many provi
RepositoryProviderTypeduplicate_provider_found_in_plugin.xml___1=duplicate provider found in plugin.xml:
RepositoryProviderTypeRepositoryProvider_assigned_to_the_project_must_be_a_subclass_of_RepositoryProvider___2=RepositoryProvider assigned to the project must be a subclass of RepositoryProvider:
RepositoryProviderTypeRepositoryProvider_not_registered_as_a_nature_id___3=RepositoryProvider not registered as a nature id:
+
+RepositoryProvider_providerTypeIdNotRegistered=Error configuring the RepositoryProvider the nature id is not registered as a valid RepositoryProviderType id.
+
TeamPlugin_setting_global_ignore_7=setting global ignore
TeamPlugin_renaming_21=renaming
TeamPlugin_closing_stream_22=closing stream
TeamPlugin_closing_stream_23=closing stream
+
+

Back to the top