Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Macguire2002-06-04 19:47:20 +0000
committerKevin Macguire2002-06-04 19:47:20 +0000
commitb6edf6132403c5cd93f49f634adc80eaf6b879fe (patch)
tree42ea694b74616d43a0045d24d5d3abf99259d059
parent89126f962a185eb740634b18b8141a9ca8e9ac6d (diff)
downloadeclipse.platform.team-b6edf6132403c5cd93f49f634adc80eaf6b879fe.tar.gz
eclipse.platform.team-b6edf6132403c5cd93f49f634adc80eaf6b879fe.tar.xz
eclipse.platform.team-b6edf6132403c5cd93f49f634adc80eaf6b879fe.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java24
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java8
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties3
3 files changed, 28 insertions, 7 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 12b39e24b..171a32c12 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
@@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.team.internal.core.*;
@@ -103,11 +104,19 @@ public abstract class RepositoryProvider implements IProjectNature {
* Instantiate the provider denoted by ID and store in session property.
* Return the new provider instance.
*/
- private static RepositoryProvider mapNewProvider(IProject project, String id) throws CoreException {
+ private static RepositoryProvider mapNewProvider(IProject project, String id) throws TeamException {
RepositoryProvider provider = newProvider(id); // instantiate via extension point
+
+ if(provider == null)
+ throw new TeamException(Policy.bind("RepositoryProvider.couldNotInstantiateProvider", project.getName(), id));
+
provider.setProject(project);
//store provider instance as session property
- project.setSessionProperty(PROVIDER_PROP_KEY, provider);
+ try {
+ project.setSessionProperty(PROVIDER_PROP_KEY, provider);
+ } catch (CoreException e) {
+ throw TeamPlugin.wrapException(e);
+ }
return provider;
}
@@ -286,7 +295,9 @@ public abstract class RepositoryProvider implements IProjectNature {
}
}
} catch(CoreException e) {
- TeamPlugin.log(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind(""), e)); //$NON-NLS-1$
+ TeamPlugin.log(e.getStatus());
+ } catch(TeamException e) {
+ TeamPlugin.log(e.getStatus());
}
return null;
}
@@ -331,9 +342,11 @@ public abstract class RepositoryProvider implements IProjectNature {
}
}
}
- } catch(CoreException ex) {
+ } catch(CoreException e) {
// would happen if provider nature id is not registered with the resources plugin
- TeamPlugin.log(new Status(IStatus.WARNING, TeamPlugin.ID, 0, Policy.bind("RepositoryProviderTypeRepositoryProvider_not_registered_as_a_nature_id___3") + id, ex)); //$NON-NLS-1$
+ TeamPlugin.log(new Status(IStatus.WARNING, TeamPlugin.ID, 0, Policy.bind("RepositoryProviderTypeRepositoryProvider_not_registered_as_a_nature_id___3", id), e)); //$NON-NLS-1$
+ } catch(TeamException e) {
+ TeamPlugin.log(e.getStatus());
}
return null;
}
@@ -409,5 +422,4 @@ public abstract class RepositoryProvider implements IProjectNature {
}
return null;
}
-
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
index 9f0785f0b..4f220972c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
@@ -10,11 +10,14 @@
******************************************************************************/
package org.eclipse.team.internal.core;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.target.TargetManager;
@@ -111,5 +114,10 @@ final public class TeamPlugin extends Plugin {
IStatus status = e.getStatus();
return new TeamException(new Status(status.getSeverity(), ID, status.getCode(), status.getMessage(), e));
}
+
+ public static void convertNatureToProperty(IProject project, String id) throws TeamException {
+ Team.removeNatureFromProject(project, id, new NullProgressMonitor());
+ RepositoryProvider.map(project, id);
+ }
} \ No newline at end of file
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 cc3c08959..1ce88b4ef 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
@@ -27,9 +27,10 @@ RepositoryProvider_Error_removing_nature_from_project___1=Error removing nature
RepositoryProvider_Too_many_providers_associated_with_project___2=Too many providers associated with project:
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:
+RepositoryProviderTypeRepositoryProvider_not_registered_as_a_nature_id___3=RepositoryProvider not registered as a nature id: {1}.
RepositoryProvider_providerTypeIdNotRegistered=Error configuring the RepositoryProvider the nature id is not registered as a valid RepositoryProviderType id.
+RepositoryProvider.couldNotInstantiateProvider=Could not instantiate provider {1} for project {0}.
TeamPlugin_setting_global_ignore_7=setting global ignore
TeamPlugin_renaming_21=renaming

Back to the top