diff options
author | Jean Michel-Lemieux | 2002-03-19 03:20:11 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2002-03-19 03:20:11 +0000 |
commit | b2b27f6ac5438b3ce7f104f3a898579608e1d0ba (patch) | |
tree | 2f1b1ecf2617b76fd6474ac1f82d5cdb0869693a | |
parent | 10258b1b16f0d608561b130a52199442909ea551 (diff) | |
download | eclipse.platform.team-b2b27f6ac5438b3ce7f104f3a898579608e1d0ba.tar.gz eclipse.platform.team-b2b27f6ac5438b3ce7f104f3a898579608e1d0ba.tar.xz eclipse.platform.team-b2b27f6ac5438b3ce7f104f3a898579608e1d0ba.zip |
*** empty log message ***
48 files changed, 336 insertions, 694 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeRegistry.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeRegistry.java index d04243df4..f10cc868d 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeRegistry.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeRegistry.java @@ -1,14 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.core; -/* - * (c) Copyright IBM Corp. 2000, 2002. - * All Rights Reserved. - */ - /** * Provides a generic registry for keys and values based on file extensions. * * File extensions should be considered without the usual "*." prefix. + * + * @since 2.0 */ public interface IFileTypeRegistry { public static final int UNKNOWN = 0; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IIgnoreInfo.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IIgnoreInfo.java index ef15faf7f..d938c6303 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IIgnoreInfo.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IIgnoreInfo.java @@ -1,10 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.core; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - /** * An ignore info specifies both the pattern and the enabled state * of a globally ignored pattern. 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 d38586e4e..5c326c23c 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 @@ -1,15 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.core; -/* - * (c) Copyright IBM Corp. 2000, 2002. - * All Rights Reserved. - */ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.eclipse.core.resources.IFileModificationValidator; 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.resources.team.IMoveDeleteHook; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.team.core.internal.Policy; @@ -17,17 +31,45 @@ import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; /** * A concrete subclass of <code>RepositoryProvider</code> is created for each - * project that is shared via a repository. - * + * project that is associated with a repository provider. The lifecycle of these + * instances is managed by the platform's 'nature' mechanism. + * <p> + * To create a repository provider and have it registered with the platform a client + * must minimally (e.g. not including the user interface integration requirements): + * <ol> + * <li>extend <code>RepositoryProvider<code> + * <li>define a nature extension in <code>plugin.xml</code> that is + * part of the "org.eclipse.team.repository-provider" set. Having the repository nature + * assigned to the team set allows cardinality restrictions to be inforced by the platform + * (e.g. one repository provider can assigned to a project at a time). Here is an + * example extension point definition: + * <code> + * <extension point="org.eclipse.core.resources.natures" id="myprovidernature" name="MyRepositoryType"> + * <runtime> + * <run class="org.eclipse.myprovider.MyRepositoryProvider"/> + * </runtime> + * <one-of-nature id="org.eclipse.team.repository-provider"/> + * </extension> + * </p> + * </code> + * </ol></p> + * <p> + * Once a repository provider is registered as a nature and is in the team set, then you + * can associate a repository provider with a project by assigning to the project the + * nature id of the repository provider. + * </p> + * @see IProjectNature * @see RepositoryProviderType * * @since 2.0 */ public abstract class RepositoryProvider implements IProjectNature { + private final static String TEAM_SETID = "org.eclipse.team.repository-provider"; + /** - * Default constructor required for the resources plugin to instantiate this class from a - * extension definition. + * Default constructor required for the resources plugin to instantiate this class from + * the nature extension definition. */ public RepositoryProvider() { } @@ -35,15 +77,15 @@ public abstract class RepositoryProvider implements IProjectNature { /** * 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. + * of the project, the nature will not be assigned to the project. * * @throws CoreException if the configuration fails. */ abstract public void configureProject() throws CoreException; /** - * Configures the nature for the given project. This method is called after <code>setProject</code> - * and before the nature is added to the project. + * Configures the nature for the given project. This is called by the platform when a nature is assigned + * to a project. It is not intended to be called by clients. * <p> * The default behavior for <code>RepositoryProvider</code> subclasses is to fail the configuration * if a provider is already associated with the given project. Subclasses cannot override this method @@ -54,34 +96,26 @@ public abstract class RepositoryProvider implements IProjectNature { * @see IProjectNature#configure */ final public void configure() throws CoreException { - RepositoryProvider provider = RepositoryProviderType.getProvider(getProject()); try { configureProject(); } catch(CoreException e) { try { - TeamPlugin.removeNatureFromProject(getProject(), getID(), null); + 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$ + throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProvider_Error_removing_nature_from_project___1") + getID(), e2)); //$NON-NLS-1$ } throw e; } } + /** + * Answer the id of this provider instance. The id should be the repository provider's + * nature id. + * + * @return the nature id of this provider + */ abstract public String getID(); - /* - * Provisional. - * Returns an object which implements a set of provider neutral operations for this - * provider. Answers <code>null</code> if the provider does not wish to support these - * operations. - * - * @return the repository operations or <code>null</code> if the provider does not - * support provider neutral operations. - */ - public SimpleAccessOperations getSimpleAccess() { - return null; - } - /** * Returns an <code>IFileModificationValidator</code> for pre-checking operations * that modify the contents of files. @@ -120,4 +154,131 @@ public abstract class RepositoryProvider implements IProjectNature { public String toString() { return getProject().getName() + ":" + getID(); //$NON-NLS-1$ } + + /** + * Returns all known (registered) RepositoryProvider ids. + * + * @return an array of registered repository provider ids. + */ + final public static String[] getAllProviderTypeIds() { + IProjectNatureDescriptor[] desc = ResourcesPlugin.getWorkspace().getNatureDescriptors(); + List teamSet = new ArrayList(); + for (int i = 0; i < desc.length; i++) { + String[] setIds = desc[i].getNatureSetIds(); + if(setIds.equals(TEAM_SETID)) { + teamSet.add(desc[i].getNatureId()); + } + } + return (String[]) teamSet.toArray(new String[teamSet.size()]); + } + + /** + * Returns the provider for a given IProject or <code>null</code> if a provider is not associated with + * the project or if the project is closed or does not exist. + * <p> + * To look for a specific repository provider type, then <code>getProvider(project, id)</code> + * is a faster method. This method is should be called if the caller can work with any + * type of repository provider. + * </p> + * + * @return the repository provider associated with the project + */ + final public static RepositoryProvider getProvider(IProject project) { + try { + if(project.isAccessible()) { + IProjectDescription projectDesc = project.getDescription(); + String[] natureIds = projectDesc.getNatureIds(); + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + // for every nature id on this project, find it's natures sets and check if it is + // in the team set. + for (int i = 0; i < natureIds.length; i++) { + IProjectNatureDescriptor desc = workspace.getNatureDescriptor(natureIds[i]); + String[] setIds = desc.getNatureSetIds(); + for (int j = 0; j < setIds.length; j++) { + if(setIds[j].equals(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 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 static RepositoryProvider getProvider(IProject project, String id) { + try { + if(project.isAccessible()) { + return (RepositoryProvider)project.getNature(id); + } + } catch(ClassCastException e) { + TeamPlugin.log(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProviderTypeRepositoryProvider_assigned_to_the_project_must_be_a_subclass_of_RepositoryProvider___2") + id, e)); //$NON-NLS-1$ + } catch(CoreException ex) { + // 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$ + } + return null; + } + + /** + * Utility for adding a nature to a project. + * + * @param proj the project to add the nature + * @param natureId the id of the nature to assign to the project + * @param monitor a progress monitor to indicate the duration of the operation, or + * <code>null</code> if progress reporting is not required. + * + * @exception TeamException if a problem occured setting the nature + */ + final public static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException { + try { + IProjectDescription description = proj.getDescription(); + String[] prevNatures= description.getNatureIds(); + String[] newNatures= new String[prevNatures.length + 1]; + System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); + newNatures[prevNatures.length]= natureId; + description.setNatureIds(newNatures); + proj.setDescription(description, monitor); + } catch(CoreException e) { + throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("manager.errorSettingNature", //$NON-NLS-1$ + proj.getName(), natureId), e)); + } + } + + /** + * Utility for removing a project nature. + */ + final public static void removeNatureFromProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException { + try { + IProjectDescription description = proj.getDescription(); + String[] prevNatures= description.getNatureIds(); + List newNatures = new ArrayList(Arrays.asList(prevNatures)); + newNatures.remove(natureId); + description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()])); + proj.setDescription(description, monitor); + } catch(CoreException e) { + throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("manager.errorRemovingNature", //$NON-NLS-1$ + proj.getName(), natureId), e)); + } + } + + /* + * Provisional. + * Returns an object which implements a set of provider neutral operations for this + * provider. Answers <code>null</code> if the provider does not wish to support these + * operations. + * + * @return the repository operations or <code>null</code> if the provider does not + * support provider neutral operations. + */ + public SimpleAccessOperations getSimpleAccess() { + return null; + } } 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 deleted file mode 100644 index 830c054e9..000000000 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProviderType.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.eclipse.team.core; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * All Rights Reserved. - */ - -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; -import org.eclipse.core.runtime.Status; -import org.eclipse.team.core.internal.Policy; - -/** - * Describes a type of repository provider snf provides - * - * @see RepositoryProvider - */ -abstract public class 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 - * called by the team plugin. - * - * @throws TeamException if the provider type is already registered. - */ - /*package*/ final static void addProviderType(RepositoryProviderType providerType) throws TeamException { - } - - /** - * Returns all known (registered) <code>RepositoryProviderType</code>. - * - * @return an array of registered <code>RepositoryProviderType</code> instances. - */ - 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()]); - } - - /** - * Returns the provider for a given IProject or <code>null</code> if a provider is not associated with - * the project. This assumes that only one repository provider can be associated with a project at a - * time. - * - * @return a repository provider for the project or <code>null</code> if the project is not - * associated with a provider. - */ - final public static RepositoryProvider getProvider(IProject project) { - 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 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 static RepositoryProvider getProvider(IProject project, String id) { - try { - if(project.exists() && project.isOpen()) { - return (RepositoryProvider)project.getNature(id); - } - } catch(ClassCastException e) { - TeamPlugin.log(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("RepositoryProviderTypeRepositoryProvider_assigned_to_the_project_must_be_a_subclass_of_RepositoryProvider___2") + id, e)); //$NON-NLS-1$ - } catch(CoreException ex) { - // 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$ - } - return null; - } - - /** - * Returns all instances of the providers of this type. - * - * @return an array of repository providers - */ - 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 = getProvider(projects[i], id); - if(provider!=null) { - projectsWithMyId.add(provider); - } - } - return (RepositoryProvider[]) projectsWithMyId.toArray(new RepositoryProvider[projectsWithMyId.size()]); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/StandardOperations.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/StandardOperations.java deleted file mode 100644 index 77e0d95c8..000000000 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/StandardOperations.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * (c) Copyright 2001 MyCorporation. - * All Rights Reserved. - */ -package org.eclipse.team.core; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -public class StandardOperations { -/** - * Updates the local resource to have the same content as the corresponding remote - * resource. Where the local resource does not exist, this method will create it. - * <p> - * If the remote resource is a container (e.g. folder or project) this operation is equivalent - * to getting each non-container member of the remote resource, thereby updating the - * content of existing local members, creating local members to receive new remote resources, - * and deleting local members that no longer have a corresponding remote resource.</p> - * <p> - * The method is applied to all resources satisfying the depth parameter, described above.</p> - * <p> - * Interrupting the method (via the progress monitor) may lead to partial, but consistent, results.</p> - * - * @param resources an array of local resources to update from the corresponding remote - * resources. - * @param depth the depth to traverse the given resources, taken from <code>IResource</code> - * static constants. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem getting one or more of the resources. The - * exception will contain multiple statuses, one for each resource in the <code>resources</code> - * array. Possible status codes include: - * <ul> - * <li>NO_REMOTE_RESOURCE</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - */ - public void get(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException { - } - - /** - * Changes the state of the local resource from checked-in to checked-out and transfers the content - * of the remote resource to the local resource. - * <p> - * Where no corresponding local resource exists in the workspace, one is created (including any - * intermediate parent containers) to receive the contents of the remote resource.</p> - * <p> - * Implementations may optimistically only flag the state change locally and rely on resolving conflicts - * during check-in, or they may pessimistically also checkout or lock the remote resource during a - * local resource checkout to avoid conflicts. The provider API does not subscribe to either model - * and supports each equally.</p> - * <p> - * Where checkout is applied to a resource that is already checked-out the method has no - * effect.</p> - * - * @param resources the array of local resources to be checked-out. - * @param depth the depth to traverse the given resources, taken from <code>IResource</code> - * constants. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem checking-out one or more of the resources. - * The exception will contain multiple statuses, one for each resource in the <code>resources</code> - * array. Possible status codes include: - * <ul> - * <li>NOT_CHECKED_IN</li> - * <li>NO_REMOTE_RESOURCE</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - * @see checkin(IResource[], int, IProgressMonitor) - */ - public void checkout(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException { - } - - /** - * Transfers the content of the local resource to the corresponding remote resource, and changes the - * state of the local resource from checked-out to checked-in. - * <p> - * If a remote resource does not exist this method creates a new remote resource with the same content - * as the given local resource. The local resource is said to <i>correspond</i> to the new remote resource.</p> - * <p> - * Where providers deal with stores that check-out or lock resources this method is an opportunity - * to transfer the content and make the corresponding remote check-in or unlock. It is envisaged that - * where the server maintains resource versions, checkin creates a new version of the remote resource.</p> - * <p> - * Note that some providers may <em>require</em> that a resource is checked-out before it can be - * checked-in. However, all providers must support the explicit checking out a resource before checking - * it in (e.g., even if the check out is a no-op).</p> - * - * @param resources an array of local resources to be checked-in. - * @param the depth to traverse the given resources, taken from <code>IResource</code> - * constants. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem checking-in one or more of the resources. - * The exception will contain multiple statuses, one for each resource in the <code>resources</code> - * array. Possible status codes include: - * <ul> - * <li>NOT_CHECKED_OUT</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - * @see checkout(IResource[], int, IProgressMonitor) - */ - public void checkin(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException { - } - - /** - * Changes the state of the local resource from checked-out to checked-in without updating the contents - * of the remote resource. - * <p> - * Note that where the provider is a versioning provider, it is envisaged (though not required) that the - * uncheckout operation does not create a new version.</p> - * <p> - * Note also that <code>uncheckout()</code> does not affect the content of the local resource. The - * caller is required to perform a <code>get()</code> to revert the local resource if that is required - * (otherwise the local resource will be left with the changes that were made while the remote resource - * was checked-out. Furthermore, it is valid to call <code>uncheckout()</code> with an - * <code>IResource</code> that does not exist locally.</p> - * - * @param resources an array of the local resources that are to be unchecked-out. - * @param depth the depth to traverse the given resources, taken from <code>IResource</code> - * constants. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem undoing the check-out of one or more of - * the resources. The exception will contain multiple statuses, one for each resource in the - * <code>resources</code> array. Possible status codes include: - * <ul> - * <li>NOT_CHECKED_OUT</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - * @see checkin(IResource) - * @see uncheckout(IResource) - */ - public void uncheckout(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException { - } - - /** - * Deletes the remote resource corresponding to the given local resource. - * <p> - * The notion of delete is simply to make the remote resource unavailable. Where the provider - * supports versioning it is not specified whether the delete operation makes the version - * temporarily or forever unavailable, or indeed whether the entire history is made unavailable.</p> - * <p> - * Note that the <code>IResource</code>'s passed as arguments may be non-existant in the - * workbench, the typical case is when such a resource has been received in a core callback.</p> - * <p> - * The resource may be checked-in or checked-out prior to deletion. The local resource is not - * deleted by this method.</p> - * <p> - * Resource deletions are inherently deep.</p> - * - * @param resources the array of resources whose corresponding remote resources are to be deleted. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem deleting one or more of - * the resources. The exception will contain multiple statuses, one for each resource in the - * <code>resources</code> array. Possible status codes include: - * <ul> - * <li>NO_REMOTE_RESOURCE</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - */ - public void delete(IResource[] resources, IProgressMonitor progress) throws TeamException { - } - - /** - * Informs the provider that a local resource's name or path has changed. - * <p> - * Some providers, such as versioning providers, may require this information to track the resource - * across name changes.</p> - * <p> - * Note that this method is always called <em>after</em> the local resource has been moved.</p> - * - * @param source the full name of the resource before it was moved. - * @param target the resource that was moved. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem recording the move. The exception will - * contain a single status. Possible status codes are: - * <ul> - * <li>NO_REMOTE_RESOURCE</li> - * <li>IO_FAILED</li> - * <li>NOT_AUTHORIZED</li> - * <li>UNABLE</li> - * </ul> - */ - public void moved(IPath source, IResource target, IProgressMonitor progress) throws TeamException { - } - - /* - * Implementor's Note: - * The following methods are required to return promptly (i.e., they may be used to determine the state of - * a resource in a UI where long delays are unacceptable). Implementations may cache these values - * and update the cache on an explicit call to #refreshState(). - * - * They are currently listed in the provider API, however, they may be moved to a new or different - * interface in the future to better reflect their UI-orientation. - */ - - /** - * Answers if the remote resource state is checked-out. If the resource has never been checked in this - * method will return <code>true</code>. - * <p> - * It is undefined whether this method tests for a resource being checked out to this workspace - * or any workspace.</p> - * - * @param resource the local resource to test. - * @return <code>true</code> if the resource is checked-out and <code>false</code> if it is not. - * @see checkout(IResource[], int, IProgressMonitor) - * @see refreshState(IResource[], int, IProgressMonitor) - */ - public boolean isCheckedOut(IResource resource) { - return false; - } - - /** - * Answers whether the resource has a corresponding remote resource. - * <p> - * Before a resource is checked-in, the resource will occur locally but not remotely, and calls to this - * method will return <code>false</code>. Once a local resource is checked in (and assuming the local - * local resource is not moved or the remote resource deleted) there will be a corresponding remote - * resource and this method returns <code>true</code>.</p> - * - * @param resource the local resource to test. - * @return <code>true</code> if the local resource has a corresponding remote resource, - * and <code>false</code> otherwise. - * @see checkin(IResource[], int, IProgressMonitor) - * @see refreshState(IResource[], int, IProgressMonitor) - */ - public boolean hasRemote(IResource resource) { - return false; - } - - /** - * Answer if the local resource currently has a different timestamp to the base timestamp - * for this resource. - * - * @param resource the resource to test. - * @return <code>true</code> if the resource has a different modification - * timestamp, and <code>false</code> otherwise. - */ - public boolean isDirty(IResource resource) { - return false; - } - - /** - * Answers true if the base of the given resource is different to the - * released state of the given resource. - */ - public boolean isOutOfDate(IResource resource) { - return false; - } - - /** - * Allows the provider to refresh resource state information for a resource. - * <p> - * As described above, some state information may be cached by the provider implementation to - * avoid server round trips and allow responsive API calls. Where a caller is relying on this - * information being current, they should first explicitly refresh the resouce state. Of course, there - * are no guarantees that the refreshed information will not become stale immediately after the - * call to this method.</p> - * - * @param resources the array of local resources to be refreshed. - * @param depth the depth to traverse the given resources, taken from <code>IResource</code> - * constants. - * @param progress a progress monitor to indicate the duration of the operation, or - * <code>null</code> if progress reporting is not required. - * @throws TeamProviderException if there is a problem refreshing one or more of - * the resources. The exception will contain multiple statuses, one for each resource in the - * <code>resources</code> array. Possible status codes include: - * <ul> - * <li>IO_FAILED</li> - * <li>UNABLE</li> - * </ul> - */ - public void refreshState(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException { - } -} diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamException.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamException.java index 1d5943fa0..59427f2cd 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamException.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamException.java @@ -1,10 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.core; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - import org.eclipse.core.runtime.IStatus; /** @@ -14,13 +19,13 @@ import org.eclipse.core.runtime.IStatus; * response; this can also be tested on the exception instance itself. * <p> * To determine the exact cause of the failure the caller should look at each status in detail.</p> + * + * @since 2.0 */ public class TeamException extends Exception { protected IStatus status = null; - // Status codes that may appear in a TeamException... - // The operation completed successfully. public static final int OK = 0; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java index d256ac334..01e0c8375 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java @@ -1,10 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.core; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.EOFException; @@ -13,25 +18,18 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; -import java.util.List; import java.util.Map; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.team.core.internal.FileTypeRegistry; @@ -42,12 +40,14 @@ import org.eclipse.team.core.internal.Policy; * resource management plugin. * <p> * This plugin provides a lightweight registration and lookup service for - * managing global ignores patterns and file type associations. Also it - * serves as a boot strap for registration of RepositoryProviderType classes. + * managing global ignores patterns and file type associations. * </p> * * @see RepositoryProvider - * @see RepositoryProviderType + * @see IFileTypeRegistry + * @see IIgnoreInfo + * + * @since 2.0 */ final public class TeamPlugin extends Plugin { @@ -92,10 +92,6 @@ final public class TeamPlugin extends Plugin { registry = new FileTypeRegistry(); registry.startup(); - // XXX forces loading of all repository plugins, may instead want to - // lazilly initialize plugin descriptors then on demand, create the executable - // extension. - initializeRepositoryProviderTypes(); readState(); initializePluginIgnores(); } catch(TeamException e) { @@ -179,84 +175,7 @@ final public class TeamPlugin extends Plugin { TeamPlugin.log(IStatus.WARNING, Policy.bind("TeamPlugin_setting_global_ignore_7"), ex); //$NON-NLS-1$ } } - - /** - * Utility for adding a nature to a project. - */ - static public void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException { - try { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= natureId; - description.setNatureIds(newNatures); - proj.setDescription(description, monitor); - } catch(CoreException e) { - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("manager.errorSettingNature", //$NON-NLS-1$ - proj.getName(), natureId), e)); - } - } - - /** - * Utility for removing a project nature. - */ - static public void removeNatureFromProject(IProject proj, String natureId, IProgressMonitor monitor) throws TeamException { - try { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); - newNatures.remove(natureId); - description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()])); - proj.setDescription(description, monitor); - } catch(CoreException e) { - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("manager.errorRemovingNature", //$NON-NLS-1$ - proj.getName(), natureId), e)); - } - } - - /** - * Find and initialize all the registered providers - */ - private void initializeRepositoryProviderTypes() throws TeamException { - - IExtensionPoint extensionPoint = Platform.getPluginRegistry().getExtensionPoint(TeamPlugin.ID, TeamPlugin.PROVIDER_EXTENSION); - if (extensionPoint == null) { - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, Policy.bind("manager.providerExtensionNotFound"), null)); //$NON-NLS-1$ - } - - IExtension[] extensions = extensionPoint.getExtensions(); - if (extensions.length == 0) - return; - for (int i = 0; i < extensions.length; i++) { - IExtension extension = extensions[i]; - IConfigurationElement[] configs = extension.getConfigurationElements(); - if (configs.length == 0) { - // there is no configuration element - // log as an error but continue to instantiate other executable extensions. - TeamPlugin.log(IStatus.ERROR, Policy.bind("manager.providerNoConfigElems", extension.getUniqueIdentifier()), null); //$NON-NLS-1$ - continue; - } - IConfigurationElement config = configs[0]; - String configName = config.getName(); - if (!"repository".equals(config.getName())) { //$NON-NLS-1$ - String message = Policy.bind("resources.natureFormat", configName); //$NON-NLS-1$ - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, message, null)); - } - - try { - RepositoryProviderType providerType = (RepositoryProviderType) config.createExecutableExtension("provider-type"); //$NON-NLS-1$ - RepositoryProviderType.addProviderType(providerType); - } catch (ClassCastException e) { - String message = Policy.bind("resources.natureImplement", configName); //$NON-NLS-1$ - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, message, null)); - } catch (CoreException e){ - String message = Policy.bind("resources.natureImplement", configName); //$NON-NLS-1$ - throw new TeamException(new Status(IStatus.ERROR, TeamPlugin.ID, 0, message, null)); - } - } - } - + /* * Reads the ignores currently defined by extensions. */ @@ -322,6 +241,9 @@ final public class TeamPlugin extends Plugin { } } + /* + * Reads the global ignore file + */ private void readState() throws TeamException { // read saved repositories list and ignore list from disk, only if the file exists IPath pluginStateLocation = TeamPlugin.getPlugin().getStateLocation().append(GLOBALIGNORE_FILE); diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/DefaultMoveDeleteHook.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultMoveDeleteHook.java index e7b615294..fb0bc8ef7 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/DefaultMoveDeleteHook.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/DefaultMoveDeleteHook.java @@ -1,4 +1,4 @@ -package org.eclipse.team.core; +package org.eclipse.team.core.internal; /* * (c) Copyright IBM Corp. 2000, 2002. 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 cb3e1430b..d4f6d876a 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,12 +7,10 @@ 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; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamPlugin; public class FileModificationValidator implements IFileModificationValidator { @@ -29,8 +27,7 @@ public class FileModificationValidator implements IFileModificationValidator { IFile[] fileArray = new IFile[1]; for (int i = 0; i < files.length; i++) { IFile file = files[i]; - RepositoryProvider provider; - provider = RepositoryProviderType.getProvider(file.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(file.getProject()); IFileModificationValidator validator = null; if (provider != null) { validator = provider.getFileModificationValidator(); @@ -54,8 +51,7 @@ public class FileModificationValidator implements IFileModificationValidator { * @see IFileModificationValidator#validateSave(IFile) */ public IStatus validateSave(IFile file) { - RepositoryProvider provider; - provider = RepositoryProviderType.getProvider(file.getProject()); + RepositoryProvider provider = RepositoryProvider.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 6b538e0af..1736e13ea 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,12 +12,8 @@ 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 { @@ -25,8 +21,7 @@ public class MoveDeleteManager implements IMoveDeleteHook { private IMoveDeleteHook getHookFor(IResource resource) { IProject project = resource.getProject(); - RepositoryProvider provider; - provider = RepositoryProviderType.getProvider(project); + RepositoryProvider provider = RepositoryProvider.getProvider(project); if(provider==null) { return DEFAULT_HOOK; } diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/simpleAccess/SimpleAccessOperations.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/simpleAccess/SimpleAccessOperations.java index f4e1f80a5..fb012fad7 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/simpleAccess/SimpleAccessOperations.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/simpleAccess/SimpleAccessOperations.java @@ -1,10 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2002 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * IBM - Initial API and implementation + ******************************************************************************/ package org.eclipse.team.internal.simpleAccess; -/* - * (c) Copyright 2001 MyCorporation. - * All Rights Reserved. - */ - import org.eclipse.team.core.*; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; @@ -12,25 +17,23 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; - /* - * This class represents provisional API. Its here to allow experimentation with 3rd party tools - * calling providers in a repository neutral manner. - * - * A provider is not required to implement this API. - * Implementers, and those who reference it, do so with the awareness that this class may be - * removed or substantially changed at future times without warning. - * - * The <code>SimpleAccessOperations</code> class exposes a basic repository model that - * providers may implement to allow third-party plugins to perform repository operations - * programmatically. For example, a code generation tool may want to get source - * files before generating the code, and check-in the results. If a provider plugin does - * not adhere to the <i>semantics</i> of the <code>SimpleAccessOperations</code> class - * as described, they are free to opt out of implementing it. - */ - +/* + * This class represents provisional API. Its here to allow experimentation with 3rd party tools + * calling providers in a repository neutral manner. + * + * A provider is not required to implement this API. + * Implementers, and those who reference it, do so with the awareness that this class may be + * removed or substantially changed at future times without warning. + * + * The <code>SimpleAccessOperations</code> class exposes a basic repository model that + * providers may implement to allow third-party plugins to perform repository operations + * programmatically. For example, a code generation tool may want to get source + * files before generating the code, and check-in the results. If a provider plugin does + * not adhere to the <i>semantics</i> of the <code>SimpleAccessOperations</code> class + * as described, they are free to opt out of implementing it. + */ public interface SimpleAccessOperations { - - /** + /* * Updates the local resource to have the same content as the corresponding remote * resource. Where the local resource does not exist, this method will create it. * <p> @@ -61,7 +64,7 @@ public interface SimpleAccessOperations { */ public void get(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException; - /** + /* * Changes the state of the local resource from checked-in to checked-out and transfers the content * of the remote resource to the local resource. * <p> @@ -95,7 +98,7 @@ public interface SimpleAccessOperations { */ public void checkout(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException; - /** + /* * Transfers the content of the local resource to the corresponding remote resource, and changes the * state of the local resource from checked-out to checked-in. * <p> @@ -128,7 +131,7 @@ public interface SimpleAccessOperations { */ public void checkin(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException; - /** + /* * Changes the state of the local resource from checked-out to checked-in without updating the contents * of the remote resource. * <p> @@ -160,7 +163,7 @@ public interface SimpleAccessOperations { */ public void uncheckout(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException; - /** + /* * Deletes the remote resource corresponding to the given local resource. * <p> * The notion of delete is simply to make the remote resource unavailable. Where the provider @@ -190,7 +193,7 @@ public interface SimpleAccessOperations { */ public void delete(IResource[] resources, IProgressMonitor progress) throws TeamException; - /** + /* * Informs the provider that a local resource's name or path has changed. * <p> * Some providers, such as versioning providers, may require this information to track the resource @@ -223,7 +226,7 @@ public interface SimpleAccessOperations { * interface in the future to better reflect their UI-orientation. */ - /** + /* * Answers if the remote resource state is checked-out. If the resource has never been checked in this * method will return <code>true</code>. * <p> @@ -233,11 +236,10 @@ public interface SimpleAccessOperations { * @param resource the local resource to test. * @return <code>true</code> if the resource is checked-out and <code>false</code> if it is not. * @see checkout(IResource[], int, IProgressMonitor) - * @see refreshState(IResource[], int, IProgressMonitor) */ public boolean isCheckedOut(IResource resource); - /** + /* * Answers whether the resource has a corresponding remote resource. * <p> * Before a resource is checked-in, the resource will occur locally but not remotely, and calls to this @@ -253,7 +255,7 @@ public interface SimpleAccessOperations { */ public boolean hasRemote(IResource resource); - /** + /* * Answer if the local resource currently has a different timestamp to the base timestamp * for this resource. * 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 d0f1f5c34..920751b68 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 @@ -45,7 +45,6 @@ import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.ccvs.core.IConnectionMethod; import org.eclipse.team.core.IFileTypeRegistry; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.client.Checkout; @@ -177,7 +176,7 @@ public class CVSProvider implements ICVSProvider { IFile vcm_meta = project.getFile(".vcm_meta"); ICVSFile project_meta = CVSWorkspaceRoot.getCVSFileFor(project.getFile(".project")); if ( ! vcm_meta.exists() && ! project_meta.isManaged()) { - TeamPlugin.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 100)); + RepositoryProvider.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 100)); } // if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) { // TeamPlugin.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 100)); @@ -375,7 +374,6 @@ public class CVSProvider implements ICVSProvider { // Get the command arguments String[] arguments = new String[resources.length]; for (int i = 0; i < resources.length; i++) { - ICVSRemoteFolder iCVSRemoteFolder = resources[i]; if (resources[i] instanceof RemoteModule) { arguments[i] = ((RemoteModule)resources[i]).getName(); } else { @@ -474,7 +472,7 @@ public class CVSProvider implements ICVSProvider { // (unless the project already has the proper nature from the project meta-information) try { if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) { - TeamPlugin.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 1)); + RepositoryProvider.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 1)); } } catch (CoreException e) { throw wrapException(e); @@ -551,7 +549,7 @@ public class CVSProvider implements ICVSProvider { // (unless the project already has the proper nature from the project meta-information) try { if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) - TeamPlugin.addNatureToProject(project, CVSProviderPlugin.getTypeId(), monitor); + RepositoryProvider.addNatureToProject(project, CVSProviderPlugin.getTypeId(), monitor); } catch (CoreException e) { throw wrapException(e); } @@ -597,7 +595,7 @@ 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], CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.getProvider(projects[i], CVSProviderPlugin.getTypeId()); if (provider!=null) { ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(projects[i]); FolderSyncInfo info = folder.getFolderSyncInfo(); 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 a2c3aa938..8588e2970 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 @@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.CVSProvider; @@ -201,7 +200,7 @@ 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, getTypeId()); + RepositoryProvider provider = RepositoryProvider.getProvider(project, getTypeId()); if(provider==null) continue; /* Check if the project description changed. */ if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) { 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 7b0e92c2f..7e1cbefed 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 @@ -36,7 +36,6 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.team.core.IFileTypeRegistry; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.core.sync.IRemoteSyncElement; 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 2140dfffb..c001cc67d 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 @@ -30,7 +30,6 @@ import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSFile; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.Policy; @@ -227,7 +226,7 @@ public class ProjectDescriptionManager { IResource resource = delta.getResource(); if (resource.getType() == IResource.PROJECT) { IProject project = (IProject)resource; - RepositoryProvider provider = RepositoryProviderType.getProvider(project, CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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); 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 33e5fe22d..780e02310 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 @@ -20,7 +20,6 @@ import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.ICVSFile; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.Policy; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; @@ -195,13 +194,13 @@ 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(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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. if ((delta.getFlags() & IResourceDelta.MOVED_TO) > 0) { IResource destination = getResourceFor(resource.getProject(), resource, delta.getMovedToPath()); - provider = RepositoryProviderType.getProvider(destination.getProject()); + provider = RepositoryProvider.getProvider(destination.getProject()); } if(provider!=null) { 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 f1e9fb6b5..174799520 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 @@ -22,7 +22,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.internal.ccvs.core.Policy; public abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor { @@ -47,13 +46,13 @@ public abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor { IResourceDelta delta = projectDeltas[i]; IResource resource = delta.getResource(); - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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. if ((delta.getFlags() & IResourceDelta.MOVED_TO) > 0) { IResource destination = getResourceFor(resource.getProject(), resource, delta.getMovedToPath()); - provider = RepositoryProviderType.getProvider(destination.getProject()); + provider = RepositoryProvider.getProvider(destination.getProject()); } if(provider != null) { 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 bed19a531..38c2aac02 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 @@ -29,7 +29,6 @@ import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; @@ -117,7 +116,7 @@ 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(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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 a20536789..43c1f810a 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 @@ -30,7 +30,6 @@ import org.eclipse.team.ccvs.core.CVSProviderPlugin; 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.util.ResourceDeltaVisitor; import org.eclipse.ui.internal.DecoratorDefinition; import org.eclipse.ui.internal.DecoratorManager; @@ -319,7 +318,7 @@ 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(), CVSProviderPlugin.getTypeId()); + RepositoryProvider p = RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); if (p == null) { return null; } 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 9d413f11b..152aa1370 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 @@ -36,7 +36,7 @@ import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.ccvs.core.IUserInfo; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.wizards.UpdateWizard; @@ -202,7 +202,7 @@ public class CVSPropertiesPage extends PropertyPage { private void initializeValues() { passwordChanged = false; - provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project, CVSProviderPlugin.getTypeId()); + provider = (CVSTeamProvider)RepositoryProvider.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, CVSProviderPlugin.getTypeId()); + provider = (CVSTeamProvider)RepositoryProvider.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 3963b85b4..8335557aa 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 @@ -64,7 +64,7 @@ import org.eclipse.team.ccvs.core.ICVSRemoteFile; import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ILogEntry; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput.HistoryLabelProvider; @@ -640,7 +640,7 @@ public class HistoryView extends ViewPart implements ISelectionListener { if (resource instanceof IFile) { IFile file = (IFile)resource; this.file = file; - RepositoryProvider teamProvider = RepositoryProviderType.getProvider(file.getProject(), CVSProviderPlugin.getTypeId()); + RepositoryProvider teamProvider = RepositoryProvider.getProvider(file.getProject(), CVSProviderPlugin.getTypeId()); if (teamProvider != null) { this.provider = (CVSTeamProvider)teamProvider; try { 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 5591babb2..f21b5c278 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 @@ -37,7 +37,6 @@ import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.ccvs.core.ILogEntry; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.sync.IRemoteResource; import org.eclipse.team.core.sync.IRemoteSyncElement; @@ -496,7 +495,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(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject(), CVSProviderPlugin.getTypeId()); List list = (List)result.get(provider); if (list == null) { list = new ArrayList(); @@ -513,7 +512,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(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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 1f5b213db..d780c49c1 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 @@ -39,7 +39,7 @@ 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; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.merge.ProjectElement; @@ -202,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(), CVSProviderPlugin.getTypeId()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.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/AddAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java index 92333a316..ed25c06ad 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java @@ -19,7 +19,6 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.Policy; @@ -66,7 +65,7 @@ public class AddAction extends TeamAction { IResource[] resources = getSelectedResources(); if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { - RepositoryProvider provider = RepositoryProviderType.getProvider(resources[i].getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject()); if(provider == null) return false; ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resources[i]); if(cvsResource.isFolder()) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java index 89e60d1b9..8e6874bec 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java @@ -11,7 +11,6 @@ import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.wizards.BranchWizard; @@ -44,7 +43,7 @@ public class BranchAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); if (provider == null) return false; ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); if (resource.getType()!=IResource.PROJECT&&!cvsResource.isManaged()) return false; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java index acedc7821..087dc0bf0 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java @@ -12,7 +12,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; @@ -53,7 +52,7 @@ public class CommitAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); if (provider == null) return false; ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); if (resource.getType()!=IResource.PROJECT&&!cvsResource.isManaged()) return false; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java index 69bda2d63..4fab6bd75 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java @@ -18,7 +18,7 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ICVSResource; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; @@ -99,7 +99,7 @@ public class CompareWithRemoteAction extends TeamAction { protected boolean isEnabled() { IResource[] resources = getSelectedResources(); if (resources.length != 1) return false; - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resources[0].getProject()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resources[0].getProject()); if(provider==null) return false; return provider.hasRemote(resources[0]); } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java index faef3e963..bcafe1706 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java @@ -12,7 +12,7 @@ import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.team.ccvs.core.CVSTeamProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.team.internal.ccvs.ui.wizards.GenerateDiffFileWizard; @@ -31,7 +31,7 @@ public class GenerateDiffFileAction extends TeamAction { */ protected boolean checkSharing(IResource[] resources) throws CoreException { for (int i = 0; i < resources.length; i++) { - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resources[i].getProject()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resources[i].getProject()); if (provider==null) { return false; } 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 4ca40a284..1d6babd56 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 @@ -24,7 +24,6 @@ import org.eclipse.team.ccvs.core.ICVSProvider; import org.eclipse.team.ccvs.core.ICVSRemoteFile; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.ui.Policy; @@ -81,7 +80,7 @@ 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], CVSProviderPlugin.getTypeId()); + RepositoryProvider teamProvider = RepositoryProvider.getProvider(projects[j], CVSProviderPlugin.getTypeId()); if (teamProvider!=null) { CVSTeamProvider cvsProvider = (CVSTeamProvider)teamProvider; if (cvsProvider.getCVSWorkspaceRoot().getRemoteLocation().equals(roots[i])) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java index 49ceee52b..2e77ab009 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.ccvs.core.CVSTeamProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.ui.actions.WorkspaceModifyOperation; @@ -65,7 +65,7 @@ public class ReplaceWithRemoteAction extends ReplaceWithAction { IResource[] resources = getSelectedResources(); if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resources[i].getProject()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resources[i].getProject()); if (provider == null) return false; if (!provider.hasRemote(resources[i])) return false; } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java index cf0591a56..c70f85f30 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java @@ -16,7 +16,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.ccvs.core.CVSTag; import org.eclipse.team.ccvs.core.CVSTeamProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog; @@ -68,7 +68,7 @@ public class ReplaceWithTagAction extends ReplaceWithAction { run(new WorkspaceModifyOperation() { public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException { try { - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resource[0].getProject()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resource[0].getProject()); monitor.beginTask(null, 100); monitor.setTaskName(Policy.bind("ReplaceWithTagAction.replacing", tag[0].getName())); provider.get(resource, IResource.DEPTH_INFINITE, tag[0], Policy.subMonitorFor(monitor, 100)); 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 05f097b20..7e0b622f3 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 @@ -11,9 +11,7 @@ import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; -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.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.wizards.KSubstWizard; @@ -48,7 +46,7 @@ public class SetKeywordSubstitutionAction extends TeamAction { // resource must be local if (! resource.isAccessible()) return false; // provider must be CVS - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); + RepositoryProvider provider = RepositoryProvider.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) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java index 7959bf043..c8b97afef 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java @@ -27,7 +27,6 @@ import org.eclipse.team.ccvs.core.CVSTag; import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; @@ -115,7 +114,7 @@ public class TagAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); if (provider == null) return false; ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); if (resource.getType()!=IResource.PROJECT&&!cvsResource.isManaged()) return false; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java index c4d791a63..f54176758 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java @@ -34,7 +34,6 @@ import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; @@ -161,7 +160,7 @@ public class UnmanageAction extends TeamAction { if(deleteContent) { folder.unmanage(); } - TeamPlugin.removeNatureFromProject((IProject)resource, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(subMonitor, 10)); + RepositoryProvider.removeNatureFromProject((IProject)resource, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(subMonitor, 10)); CVSDecorator.refresh(resource); } } @@ -195,7 +194,7 @@ public class UnmanageAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { if(resources[i].getType()!=IResource.PROJECT) return false; - RepositoryProvider provider = RepositoryProviderType.getProvider(resources[i].getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject()); if (provider == null) return false; ICVSFolder project = CVSWorkspaceRoot.getCVSFolderFor((IContainer)resources[i]); if (!project.isCVSFolder()) return false; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java index e858498d9..fd5c8e61b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java @@ -19,7 +19,6 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.client.Command; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; @@ -72,7 +71,7 @@ public class UpdateAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); if (provider == null) return false; ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); ResourceSyncInfo info = cvsResource.getSyncInfo(); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java index 9aa07a9b5..05075f699 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java @@ -25,7 +25,6 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.ccvs.core.ICVSRemoteFolder; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; @@ -133,7 +132,7 @@ public class BranchWizard extends Wizard { 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 = RepositoryProvider.getProvider(resources[i].getProject()); 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/wizards/GenerateDiffFileOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileOperation.java index 27dd8a0fc..340af06e6 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileOperation.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileOperation.java @@ -23,7 +23,7 @@ import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.ccvs.core.CVSTeamProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; import org.eclipse.team.internal.ccvs.ui.Policy; @@ -67,7 +67,7 @@ public class GenerateDiffFileOperation implements IRunnableWithProgress { try { for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(resource.getProject()); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resource.getProject()); provider.diff(new IResource[] {resource}, options, new PrintStream(os), new SubProgressMonitor(monitor, 500)); } } finally { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizard.java index a6e8acf00..7615a06e2 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizard.java @@ -28,13 +28,10 @@ import org.eclipse.swt.graphics.Cursor; import org.eclipse.team.ccvs.core.CVSStatus; import org.eclipse.team.ccvs.core.CVSTeamProvider; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.Policy; -import org.eclipse.ui.internal.IWorkbenchConstants; -import org.eclipse.ui.internal.IWorkbenchGraphicConstants; /** * A wizard for changing the keyword substitution mode of files. @@ -296,7 +293,7 @@ public class KSubstWizard extends Wizard { IFile file = (IFile) entry.getKey(); KSubstOption toKSubst = (KSubstOption) entry.getValue(); // classify file according to its provider - RepositoryProvider provider = RepositoryProviderType.getProvider(file.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(file.getProject()); Map providerMap = (Map) table.get(provider); if (providerMap == null) { providerMap = new HashMap(); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java index 0e2366316..dbc39fa20 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java @@ -17,9 +17,8 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.wizard.Wizard; import org.eclipse.team.ccvs.core.CVSTeamProvider; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; @@ -63,7 +62,7 @@ public class UpdateWizard extends Wizard { getContainer().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException { try { - CVSTeamProvider provider = ((CVSTeamProvider)RepositoryProviderType.getProvider(project)); + CVSTeamProvider provider = ((CVSTeamProvider)RepositoryProvider.getProvider(project)); provider.update(new IResource[] {project}, updatePage.getLocalOptions(), updatePage.getTag(), null, monitor); result[0] = true; } catch (TeamException e) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java index 2a7b0f533..099e9c21c 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java @@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; import org.eclipse.team.internal.ui.Policy; @@ -61,7 +60,7 @@ public class CheckInAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); SimpleAccessOperations ops = provider.getSimpleAccess(); if (provider == null || ops == null) return false; if (!ops.isCheckedOut(resource)) return false; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java index 4ba4cab0b..f881a9a0b 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java @@ -16,8 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; -import org.eclipse.team.core.StandardOperations; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; import org.eclipse.team.internal.ui.Policy; @@ -62,7 +60,7 @@ public class CheckOutAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); SimpleAccessOperations ops = provider.getSimpleAccess(); if (provider == null || ops == null) return false; if (ops.isCheckedOut(resource)) return false; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java index 314f1e563..6564bbbd7 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java @@ -12,8 +12,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.team.core.RepositoryProviderType; -import org.eclipse.team.core.TeamPlugin; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.internal.ui.ConfigureProjectWizard; import org.eclipse.team.internal.ui.Policy; @@ -48,7 +47,7 @@ public class ConfigureProjectAction extends TeamAction { IProject[] selectedProjects = getSelectedProjects(); if (selectedProjects.length != 1) return false; if (!selectedProjects[0].isAccessible()) return false; - if (RepositoryProviderType.getProvider(selectedProjects[0]) == null) return true; + if (RepositoryProvider.getProvider(selectedProjects[0]) == null) return true; return false; } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java index 36e8afa6a..76cc1a7e0 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java @@ -10,7 +10,7 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IAction; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.internal.ui.Policy; import org.eclipse.ui.actions.WorkspaceModifyOperation; @@ -40,7 +40,7 @@ public class DeconfigureProjectAction extends TeamAction { protected boolean isEnabled() { IProject[] selectedProjects = getSelectedProjects(); if (selectedProjects.length != 1) return false; - if (RepositoryProviderType.getProvider(selectedProjects[0]) != null) return false; + if (RepositoryProvider.getProvider(selectedProjects[0]) != null) return false; return true; } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java index 2464b222f..8625ce53e 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java @@ -18,8 +18,6 @@ import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; -import org.eclipse.team.core.StandardOperations; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; import org.eclipse.team.internal.ui.Policy; @@ -78,7 +76,7 @@ public class DeleteAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); SimpleAccessOperations ops = provider.getSimpleAccess(); if (provider == null || ops == null) return false; if (!ops.hasRemote(resource)) return false; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java index b6cfe1686..04620ab4c 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java @@ -16,8 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; -import org.eclipse.team.core.StandardOperations; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; import org.eclipse.team.internal.ui.Policy; @@ -62,7 +60,7 @@ public class GetAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); SimpleAccessOperations ops = provider.getSimpleAccess(); if (provider == null || ops == null) return false; if (!ops.hasRemote(resource)) return false; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java index 87e912e5d..f640d824b 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java @@ -28,7 +28,6 @@ import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ui.Policy; import org.eclipse.team.ui.TeamUIPlugin; @@ -280,7 +279,7 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction protected 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 = RepositoryProvider.getProvider(resources[i].getProject()); List list = (List)result.get(provider); if (list == null) { list = new ArrayList(); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java index 54789f714..bcb3a6240 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java @@ -16,8 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.RepositoryProviderType; -import org.eclipse.team.core.StandardOperations; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.simpleAccess.SimpleAccessOperations; import org.eclipse.team.internal.ui.Policy; @@ -62,7 +60,7 @@ public class UndoCheckOutAction extends TeamAction { if (resources.length == 0) return false; for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; - RepositoryProvider provider = RepositoryProviderType.getProvider(resource.getProject()); + RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject()); SimpleAccessOperations ops = provider.getSimpleAccess(); if (provider == null || ops == null) return false; if (!ops.hasRemote(resource)) return false; diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java index cc452d39d..d79d7766f 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java @@ -34,7 +34,7 @@ import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSRemoteFile; import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ICVSResource; -import org.eclipse.team.core.RepositoryProviderType; +import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.CVSProvider; @@ -431,7 +431,7 @@ public class EclipseTest extends EclipseWorkspaceTest { protected void assertValidCheckout(IProject project) { // NOTE: Add code to ensure that the project was checkout out properly - CVSTeamProvider provider = (CVSTeamProvider)RepositoryProviderType.getProvider(project); + CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project); assertNotNull(provider); } protected InputStream getContents(ICVSFile file) throws CVSException, IOException { @@ -458,7 +458,7 @@ public class EclipseTest extends EclipseWorkspaceTest { return target; } protected CVSTeamProvider getProvider(IResource resource) throws TeamException { - return (CVSTeamProvider)RepositoryProviderType.getProvider(resource.getProject()); + return (CVSTeamProvider)RepositoryProvider.getProvider(resource.getProject()); } protected static InputStream getRandomContents(int sizeAtLeast) { StringBuffer randomStuff = new StringBuffer(sizeAtLeast + 100); |