Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-03-18 20:28:40 +0000
committerJean Michel-Lemieux2002-03-18 20:28:40 +0000
commit62cc51f65b38cbf4fce54b17f9ab6b41bd60a48a (patch)
tree4776d9c99803519f93509bf5dd2d3e7e11659ba1
parentf8aae016b6f1546b55f7420239a344fd813cf299 (diff)
downloadeclipse.platform.team-62cc51f65b38cbf4fce54b17f9ab6b41bd60a48a.tar.gz
eclipse.platform.team-62cc51f65b38cbf4fce54b17f9ab6b41bd60a48a.tar.xz
eclipse.platform.team-62cc51f65b38cbf4fce54b17f9ab6b41bd60a48a.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/plugin.xml1
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java53
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java93
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java7
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/MoveDeleteManager.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/plugin.xml10
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/ccvs/core/CVSRepositoryProviderType.java31
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java11
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoryManager.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java4
21 files changed, 85 insertions, 183 deletions
diff --git a/bundles/org.eclipse.team.core/plugin.xml b/bundles/org.eclipse.team.core/plugin.xml
index e9990a374..60a5476a6 100644
--- a/bundles/org.eclipse.team.core/plugin.xml
+++ b/bundles/org.eclipse.team.core/plugin.xml
@@ -17,7 +17,6 @@
</library>
</runtime>
-<extension-point id="repository-provider-type" name="Repository Provider Types"/>
<extension-point id="fileTypes" name="File Types Registry"/>
<extension-point id="ignore" name="Global Ignore Registry"/>
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 11a301c4b..7aab61e4b 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
@@ -32,14 +32,6 @@ public abstract class RepositoryProvider implements IProjectNature {
}
/**
- * Returns a <code>RepositoryProviderType</code> that describes the type of this provider.
- *
- * @return the <code>RepositoryProviderType</code> of this provider
- * @see RepositoryProviderType
- */
- abstract public RepositoryProviderType getProviderType();
-
- /**
* Configures the nature for the given project. This method is called after <code>setProject</code>
* and before the nature is added to the project. If an exception is generated during configuration
* of the project the nature will not be assigned to the project.
@@ -62,48 +54,19 @@ public abstract class RepositoryProvider implements IProjectNature {
*/
final public void configure() throws CoreException {
RepositoryProvider provider = RepositoryProviderType.getProvider(getProject());
- // Core Bug 11395
- // When configure is called the nature has already been assigned to the project. This check will always
- // fail. Also, if configure fails the nature is still added to the project.
- //if(provider!=null) {
- // throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, "A provider is already associated with this project: " + provider, null));
- //}
- // Alternate slower check
- RepositoryProviderType[] types = RepositoryProviderType.getAllProviderTypes();
- int count = 0;
- for (int i = 0; i < types.length; i++) {
- if(getProject().getNature(types[i].getID())!=null) {
- count++;
- }
- }
- if(count==1) {
+ try {
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
+ } catch(CoreException e) {
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$
+ TeamPlugin.removeNatureFromProject(getProject(), getID(), null);
+ } catch(TeamException e2) {
+ throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_Error_removing_nature_from_project___1") + provider, e2)); //$NON-NLS-1$
}
- 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$
- }
+ throw e;
}
}
- /**
- * Returns <code>true</code> if this provider is of the given type id and <code>false</code>
- * otherwise.
- */
- public boolean isOfType(String id) {
- return getProviderType().getID().equals(id);
- }
+ abstract public String getID();
/**
* Returns an object which implements a set of provider neutral operations for this
@@ -161,6 +124,6 @@ public abstract class RepositoryProvider implements IProjectNature {
* @return a string description of this provider
*/
public String toString() {
- return getProject().getName() + ":" + getProviderType(); //$NON-NLS-1$
+ return getProject().getName() + ":" + getID(); //$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 864cc7fa0..830c054e9 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
@@ -6,11 +6,16 @@ package org.eclipse.team.core;
*/
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IProjectNatureDescriptor;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -24,16 +29,7 @@ import org.eclipse.team.core.internal.Policy;
*/
abstract public class RepositoryProviderType {
- // contains a list of registered provider types keyed by provider type id.
- // {keys = String (ids) values = RepositoryProviderType
- private static final Map providerTypes = new HashMap();
-
- /**
- * Default constructor required for the team plugin to instantiate this class from a
- * extension definition.
- */
- public RepositoryProviderType() {
- }
+ private final static String TEAM_SETID = "org.eclipse.team.repository-provider";
/**
* Registers a provider type. This method is not intended to be called by clients and should only be
@@ -42,11 +38,6 @@ abstract public class RepositoryProviderType {
* @throws TeamException if the provider type is already registered.
*/
/*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 {
- providerTypes.put(providerType.getID(), providerType);
- }
}
/**
@@ -54,8 +45,16 @@ abstract public class RepositoryProviderType {
*
* @return an array of registered <code>RepositoryProviderType</code> instances.
*/
- final public static RepositoryProviderType[] getAllProviderTypes() {
- return (RepositoryProviderType[]) providerTypes.values().toArray(new RepositoryProviderType[providerTypes.size()]);
+ final public static String[] getAllProviderTypeIds() {
+ IProjectNatureDescriptor[] desc = ResourcesPlugin.getWorkspace().getNatureDescriptors();
+ List teamSet = new ArrayList();
+ for (int i = 0; i < desc.length; i++) {
+ List sets = new ArrayList(Arrays.asList(desc[i].getNatureSetIds()));
+ if(sets.contains(TEAM_SETID)) {
+ teamSet.add(desc[i].getNatureId());
+ }
+ }
+ return (String[]) teamSet.toArray(new String[teamSet.size()]);
}
/**
@@ -67,35 +66,32 @@ abstract public class RepositoryProviderType {
* associated with a provider.
*/
final public static RepositoryProvider getProvider(IProject project) {
- RepositoryProviderType[] allTypes = getAllProviderTypes();
- for (int i = 0; i < allTypes.length; i++) {
- RepositoryProvider provider = allTypes[i].getInstance(project);
- if(provider!=null) {
- return provider;
+ if(project.isAccessible()) {
+ try {
+ IProjectDescription projectDesc = project.getDescription();
+ String[] natureIds = projectDesc.getNatureIds();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ for (int i = 0; i < natureIds.length; i++) {
+ IProjectNatureDescriptor desc = workspace.getNatureDescriptor(natureIds[i]);
+ List sets = new ArrayList(Arrays.asList(desc.getNatureSetIds()));
+ if(sets.contains(TEAM_SETID)) {
+ return getProvider(project, natureIds[i]);
+ }
+ }
+ } catch(CoreException e) {
+ TeamPlugin.log(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind(""), e)); //$NON-NLS-1$
}
}
return null;
}
/**
- * Returns the provider type instance with the given id or <code>null</code> if a provider type
- * with that id is not registered.
- *
- * @return a provider type with the given id or <code>null</code> if a provider with that id
- * is not registered.
- */
- final public static RepositoryProviderType getProviderType(String id) {
- return (RepositoryProviderType) providerTypes.get(id);
- }
-
- /**
* Returns a provider of type the receiver if associated with the given project or <code>null</code>
* if the project is not associated with a provider of that type.
*
* @return the repository provider
*/
- final public RepositoryProvider getInstance(IProject project) {
- String id = getID();
+ final public static RepositoryProvider getProvider(IProject project, String id) {
try {
if(project.exists() && project.isOpen()) {
return (RepositoryProvider)project.getNature(id);
@@ -110,43 +106,20 @@ abstract public class RepositoryProviderType {
}
/**
- * Returns the unique identifier for this provider type.
- * For example, org.eclipse.team.repotype.provider.
- * This identifier must match the <code>IProjectNature</code> ID of
- * the corresponding <code>RepositoryProvider</code>.
- *
- * @return the id
- */
- abstract public String getID();
-
- /**
* Returns all instances of the providers of this type.
*
* @return an array of repository providers
*/
- public RepositoryProvider[] getAllInstances() {
+ final public static RepositoryProvider[] getAllInstances(String id) {
// traverse projects in workspace and return the list of project that have our id as the nature id.
List projectsWithMyId = new ArrayList();
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (int i = 0; i < projects.length; i++) {
- RepositoryProvider provider = getInstance(projects[i]);
+ RepositoryProvider provider = getProvider(projects[i], id);
if(provider!=null) {
projectsWithMyId.add(provider);
}
}
return (RepositoryProvider[]) projectsWithMyId.toArray(new RepositoryProvider[projectsWithMyId.size()]);
}
-
- /**
- * Returns a description of this provider type. The exact details of the
- * representation are unspecified and subject to change, but the following
- * may be regarded as typical:
- *
- * "org.eclipse.team.cvs.provider"
- *
- * @return a string description of this provider type
- */
- public String toString() {
- return getID();
- }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java
index ebd30963c..cb3e1430b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/FileModificationValidator.java
@@ -7,6 +7,7 @@ package org.eclipse.team.core.internal;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFileModificationValidator;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
@@ -28,7 +29,8 @@ public class FileModificationValidator implements IFileModificationValidator {
IFile[] fileArray = new IFile[1];
for (int i = 0; i < files.length; i++) {
IFile file = files[i];
- RepositoryProvider provider = RepositoryProviderType.getProvider(file.getProject());
+ RepositoryProvider provider;
+ provider = RepositoryProviderType.getProvider(file.getProject());
IFileModificationValidator validator = null;
if (provider != null) {
validator = provider.getFileModificationValidator();
@@ -52,7 +54,8 @@ public class FileModificationValidator implements IFileModificationValidator {
* @see IFileModificationValidator#validateSave(IFile)
*/
public IStatus validateSave(IFile file) {
- RepositoryProvider provider = RepositoryProviderType.getProvider(file.getProject());
+ RepositoryProvider provider;
+ provider = RepositoryProviderType.getProvider(file.getProject());
if (provider != null) {
IFileModificationValidator validator = provider.getFileModificationValidator();
if(validator!=null) {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/MoveDeleteManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/MoveDeleteManager.java
index 3079045a3..6b538e0af 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/MoveDeleteManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/MoveDeleteManager.java
@@ -12,10 +12,12 @@ import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.team.IMoveDeleteHook;
import org.eclipse.core.resources.team.IResourceTree;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.DefaultMoveDeleteHook;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.RepositoryProviderType;
+import org.eclipse.team.core.TeamPlugin;
public class MoveDeleteManager implements IMoveDeleteHook {
@@ -23,7 +25,8 @@ public class MoveDeleteManager implements IMoveDeleteHook {
private IMoveDeleteHook getHookFor(IResource resource) {
IProject project = resource.getProject();
- RepositoryProvider provider = RepositoryProviderType.getProvider(project);
+ RepositoryProvider provider;
+ provider = RepositoryProviderType.getProvider(project);
if(provider==null) {
return DEFAULT_HOOK;
}
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml
index 89aad520f..2567a31b3 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.core/plugin.xml
@@ -39,18 +39,12 @@
</adapter>
</extension>
- <!-- *************** Team Provider **************** -->
- <extension point="org.eclipse.team.core.repository-provider-type" id="cvs-provider-type">
- <repository>
- <provider-type class="org.eclipse.team.ccvs.core.CVSRepositoryProviderType"/>
- </repository>
- </extension>
-
<!-- *************** Project Nature **************** -->
<extension point="org.eclipse.core.resources.natures" id="cvsnature" name="%cvsNature">
<runtime>
- <run class="org.eclipse.team.ccvs.core.CVSTeamProvider"/>
+ <run class="org.eclipse.team.ccvs.core.CVSTeamProvider"/>
</runtime>
+ <one-of-nature id="org.eclipse.team.repository-provider"/>
</extension>
<!-- *************** Resource patterns ignored by CVS **************** -->
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/ccvs/core/CVSRepositoryProviderType.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/ccvs/core/CVSRepositoryProviderType.java
deleted file mode 100644
index b98bd27ae..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/ccvs/core/CVSRepositoryProviderType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.team.ccvs.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.team.core.RepositoryProviderType;
-
-public class CVSRepositoryProviderType extends RepositoryProviderType {
-
- private static CVSRepositoryProviderType instance;
-
- public CVSRepositoryProviderType() {
- instance = this;
- }
-
- /*
- * Returns the one and only instance of the CVS repository type.
- */
- public static CVSRepositoryProviderType getInstance() {
- return instance;
- }
-
- /*
- * @see RepositoryProviderType#getID()
- */
- public String getID() {
- return CVSProviderPlugin.getTypeId();
- }
-}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
index 9c2abdf55..d0f1f5c34 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
@@ -597,8 +597,8 @@ public class CVSProvider implements ICVSProvider {
// the providers with which the projects in the workspace are shared.
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (int i = 0; i < projects.length; i++) {
- RepositoryProvider provider = RepositoryProviderType.getProvider(projects[i]);
- if (provider!=null && provider.isOfType(CVSProviderPlugin.getTypeId())) {
+ RepositoryProvider provider = RepositoryProviderType.getProvider(projects[i], CVSProviderPlugin.getTypeId());
+ if (provider!=null) {
ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(projects[i]);
FolderSyncInfo info = folder.getFolderSyncInfo();
if (info != null) {
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 d67375238..a2c3aa938 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
@@ -201,8 +201,8 @@ public class CVSProviderPlugin extends Plugin {
if (resource.getType() == IResource.PROJECT) {
IProject project = (IProject)resource;
// Get the team provider for the project and
- RepositoryProvider provider = RepositoryProviderType.getProvider(project);
- if(provider==null || !provider.isOfType(NATURE_ID)) continue;
+ RepositoryProvider provider = RepositoryProviderType.getProvider(project, getTypeId());
+ if(provider==null) continue;
/* Check if the project description changed. */
if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
/* The project description changed. Write the file. */
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 99c8f8b74..7b0e92c2f 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
@@ -965,10 +965,6 @@ public class CVSTeamProvider extends RepositoryProvider {
return new Status(IStatus.ERROR, CVSProviderPlugin.ID, TeamException.UNABLE, getMessageFor(e), e);
}
- public RepositoryProviderType getProviderType() {
- return CVSRepositoryProviderType.getInstance();
- }
-
public void configureProject() throws CoreException {
}
/**
@@ -1175,4 +1171,11 @@ public class CVSTeamProvider extends RepositoryProvider {
ICVSFile mFile = CVSWorkspaceRoot.getCVSFileFor(file);
mFile.setTimeStamp(null);
}
+
+ /*
+ * @see RepositoryProvider#getID()
+ */
+ public String getID() {
+ return CVSProviderPlugin.getTypeId();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
index a3e5b426f..2140dfffb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
@@ -227,8 +227,8 @@ public class ProjectDescriptionManager {
IResource resource = delta.getResource();
if (resource.getType() == IResource.PROJECT) {
IProject project = (IProject)resource;
- RepositoryProvider provider = RepositoryProviderType.getProvider(project);
- if (provider!=null && !provider.isOfType(CVSProviderPlugin.getTypeId())) continue;
+ RepositoryProvider provider = RepositoryProviderType.getProvider(project, CVSProviderPlugin.getTypeId());
+ if (provider!=null) continue;
// First, check if the .vcm_meta file for the project is in the delta.
IResourceDelta[] children = delta.getAffectedChildren(IResourceDelta.REMOVED | IResourceDelta.ADDED | IResourceDelta.CHANGED);
boolean inSync = false;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
index 0058a9bbc..33e5fe22d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
@@ -195,7 +195,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
for (int i = 0; i < projectDeltas.length; i++) {
IResourceDelta delta = projectDeltas[i];
IResource resource = delta.getResource();
- RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject());
+ RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
// if a project is moved the originating project will not be associated with the CVS provider
// however listeners will probably still be interested in the move delta.
@@ -204,7 +204,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
provider = RepositoryProviderType.getProvider(destination.getProject());
}
- if(provider!=null && provider.isOfType(CVSProviderPlugin.getTypeId())) {
+ if(provider!=null) {
delta.accept(visitor);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaVisitor.java
index f35448889..f1e9fb6b5 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaVisitor.java
@@ -47,7 +47,7 @@ public abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor {
IResourceDelta delta = projectDeltas[i];
IResource resource = delta.getResource();
- RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject());
+ RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
// if a project is moved the originating project will not be associated with the CVS provider
// however listeners will probably still be interested in the move delta.
@@ -56,7 +56,7 @@ public abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor {
provider = RepositoryProviderType.getProvider(destination.getProject());
}
- if(provider != null && provider.isOfType(CVSProviderPlugin.getTypeId())) {
+ if(provider != null) {
delta.accept(visitor);
}
}
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 f70481884..bed19a531 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
@@ -117,8 +117,8 @@ public class CVSDecorationRunnable implements Runnable {
// with a CVS provider. This could happen if the team nature was removed
// between the time the decoration event was posted to the thread and the time
// the thread processes the decoration.
- RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject());
- if(!resource.exists() || provider==null || !provider.isOfType(CVSProviderPlugin.getTypeId())) {
+ RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
+ if(!resource.exists() || provider==null) {
return null;
}
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 0f5d48760..a20536789 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
@@ -17,12 +17,10 @@ import java.util.Map;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.swt.graphics.Image;
@@ -33,10 +31,6 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.IResourceStateChangeListener;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.RepositoryProviderType;
-import org.eclipse.team.internal.ccvs.core.CVSProvider;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
-import org.eclipse.team.internal.ccvs.core.util.Assert;
import org.eclipse.team.internal.ccvs.core.util.ResourceDeltaVisitor;
import org.eclipse.ui.internal.DecoratorDefinition;
import org.eclipse.ui.internal.DecoratorManager;
@@ -325,8 +319,8 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
* will be ignored by the decorator.
*/
private static CVSTeamProvider getCVSProviderFor(IResource resource) {
- RepositoryProvider p = RepositoryProviderType.getProvider(resource.getProject());
- if (p == null || !p.isOfType(CVSProviderPlugin.getTypeId())) {
+ RepositoryProvider p = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
+ if (p == null) {
return null;
}
return (CVSTeamProvider) p;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
index 2832e082a..9d413f11b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
@@ -202,7 +202,7 @@ public class CVSPropertiesPage extends PropertyPage {
private void initializeValues() {
passwordChanged = false;
- provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project);
+ provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project, CVSProviderPlugin.getTypeId());
if (provider == null) return;
CVSWorkspaceRoot cvsRoot = provider.getCVSWorkspaceRoot();
@@ -242,7 +242,7 @@ public class CVSPropertiesPage extends PropertyPage {
}
private void initializeTag() {
- provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project);
+ provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project, CVSProviderPlugin.getTypeId());
if (provider == null) return;
CVSWorkspaceRoot cvsRoot = provider.getCVSWorkspaceRoot();
try {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index 5d0071215..3963b85b4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -640,8 +640,8 @@ public class HistoryView extends ViewPart implements ISelectionListener {
if (resource instanceof IFile) {
IFile file = (IFile)resource;
this.file = file;
- RepositoryProvider teamProvider = RepositoryProviderType.getProvider(file.getProject());
- if (teamProvider != null && teamProvider.isOfType(CVSProviderPlugin.getTypeId())) {
+ RepositoryProvider teamProvider = RepositoryProviderType.getProvider(file.getProject(), CVSProviderPlugin.getTypeId());
+ if (teamProvider != null) {
this.provider = (CVSTeamProvider)teamProvider;
try {
ICVSRemoteResource remoteResource = CVSWorkspaceRoot.getRemoteResourceFor(file);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoryManager.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoryManager.java
index 463ae0dda..5591babb2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoryManager.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoryManager.java
@@ -496,7 +496,7 @@ public class RepositoryManager {
private Hashtable getProviderMapping(IResource[] resources) {
Hashtable result = new Hashtable();
for (int i = 0; i < resources.length; i++) {
- RepositoryProvider provider = RepositoryProviderType.getProvider(resources[i].getProject());
+ RepositoryProvider provider = RepositoryProviderType.getProvider(resources[i].getProject(), CVSProviderPlugin.getTypeId());
List list = (List)result.get(provider);
if (list == null) {
list = new ArrayList();
@@ -513,7 +513,7 @@ public class RepositoryManager {
private Hashtable getProviderMapping(IRemoteSyncElement[] elements) {
Hashtable result = new Hashtable();
for (int i = 0; i < elements.length; i++) {
- RepositoryProvider provider = RepositoryProviderType.getProvider(elements[i].getLocal().getProject());
+ RepositoryProvider provider = RepositoryProviderType.getProvider(elements[i].getLocal().getProject(), CVSProviderPlugin.getTypeId());
List list = (List)result.get(provider);
if (list == null) {
list = new ArrayList();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
index 109ee330c..1f5b213db 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
@@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
@@ -201,7 +202,7 @@ public class TagSelectionDialog extends Dialog {
try {
monitor.beginTask(Policy.bind("TagSelectionDialog.fetching"), 100);
monitor.subTask(Policy.bind("TagSelectionDialog.preparing"));
- CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resource.getProject());
+ CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
monitor.worked(50);
monitor.subTask(Policy.bind("TagSelectionDialog.fetching"));
tagTree.setInput(new ProjectElement((ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(resource.getProject()), getShell()));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
index cfa032c46..4ca40a284 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
@@ -81,8 +81,8 @@ public class RemoveRootAction extends TeamAction {
boolean shared = false;
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (int j = 0; j < projects.length; j++) {
- RepositoryProvider teamProvider = RepositoryProviderType.getProvider(projects[j]);
- if (teamProvider.isOfType(CVSProviderPlugin.getTypeId())) {
+ RepositoryProvider teamProvider = RepositoryProviderType.getProvider(projects[j], CVSProviderPlugin.getTypeId());
+ if (teamProvider!=null) {
CVSTeamProvider cvsProvider = (CVSTeamProvider)teamProvider;
if (cvsProvider.getCVSWorkspaceRoot().getRemoteLocation().equals(roots[i])) {
shared = true;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
index 651e64f40..05f097b20 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
@@ -48,8 +48,8 @@ public class SetKeywordSubstitutionAction extends TeamAction {
// resource must be local
if (! resource.isAccessible()) return false;
// provider must be CVS
- RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject());
- if (provider == null || !provider.isOfType(CVSProviderPlugin.getTypeId())) return false;
+ RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
+ if (provider == null) return false;
// resource must either be a project, or it must be managed
if (resource.getType() != IResource.PROJECT) {
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);

Back to the top