Commit 2e41d2c4 authored by agurov's avatar agurov

IConnectedProjectInformation is an unneeded interface (bug 483232)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=483232

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21516 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 1109e39d
......@@ -19,6 +19,8 @@ import org.eclipse.team.svn.core.resource.IRepositoryResource;
/**
* This interface provides an information about project connection to the repository
*
* @deprecated use SVNTeamProvider directly instead
*
* @author Alexander Gurov
*/
public interface IConnectedProjectInformation {
......
......@@ -55,6 +55,7 @@ import org.eclipse.team.svn.core.utility.SVNUtility;
*
* @author Alexander Gurov
*/
@SuppressWarnings("deprecation")
public class SVNTeamProvider extends RepositoryProvider implements IConnectedProjectInformation {
public final static QualifiedName LOCATION_PROPERTY = new QualifiedName("org.eclipse.team.svn", "location"); //$NON-NLS-1$ //$NON-NLS-2$
public final static QualifiedName VERIFY_TAG_ON_COMMIT_PROPERTY = new QualifiedName("org.eclipse.team.svn", "verifyTagOnCommit"); //$NON-NLS-1$ //$NON-NLS-2$
......
......@@ -20,8 +20,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.connector.ISVNConnector;
import org.eclipse.team.svn.core.connector.SVNDepth;
import org.eclipse.team.svn.core.operation.IActionOperation;
......@@ -102,7 +102,7 @@ public class SwitchOperation extends AbstractRepositoryOperation implements IUnr
SwitchOperation.this.options, new ConflictDetectionProgressMonitor(SwitchOperation.this, monitor, null));
if (resource instanceof IProject) {
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider((IProject)resource);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider((IProject)resource);
provider.switchResource(destination);
}
}
......
......@@ -22,9 +22,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.BaseMessages;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.SVNTeamPlugin;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.connector.ISVNConnector;
import org.eclipse.team.svn.core.connector.SVNChangeStatus;
import org.eclipse.team.svn.core.connector.SVNDepth;
......@@ -81,7 +81,7 @@ public class RelocateWorkingCopyOperation extends AbstractWorkingCopyOperation i
final IProject current = (IProject)projects[i];
this.protectStep(new IUnprotectedOperation() {
public void run(IProgressMonitor monitor) throws Exception {
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(current, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(current, SVNTeamPlugin.NATURE_ID);
IPath fsLocation = current.getLocation();
if (fsLocation != null) {
String path = fsLocation.toString();
......
......@@ -44,10 +44,10 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.SVNTeamPlugin;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.connector.ISVNConnector;
import org.eclipse.team.svn.core.connector.ISVNEntryInfoCallback;
import org.eclipse.team.svn.core.connector.ISVNProgressMonitor;
......@@ -651,24 +651,24 @@ public class SVNRemoteStorage extends AbstractSVNStorage implements IRemoteStora
return baseResource.getUrl() + "/" + url.substring(project.getFullPath().toString().length() + 1); //$NON-NLS-1$
}
protected IConnectedProjectInformation getConnectedProjectInformation(IProject project) {
protected SVNTeamProvider getConnectedProjectInformation(IProject project) {
RepositoryProvider provider = RepositoryProvider.getProvider(project);
if (provider == null) {
String errMessage = SVNMessages.formatErrorString("Error_NotConnectedProject", new String[] {project.getName()}); //$NON-NLS-1$
throw new UnreportableException(errMessage);
}
if (!(provider instanceof IConnectedProjectInformation)) {
if (!(provider instanceof SVNTeamProvider)) {
String errMessage = SVNMessages.formatErrorString("Error_AnotherProvider", new String[] {project.getName(), provider.getID()}); //$NON-NLS-1$
throw new UnreportableException(errMessage);
}
return (IConnectedProjectInformation)provider;
return (SVNTeamProvider)provider;
}
protected void refreshLocalResourceImpl(IResource resource, int depth) {
if (resource.getType() != IResource.FILE) {
if (resource.getType() == IResource.PROJECT) {
IConnectedProjectInformation info = (IConnectedProjectInformation)RepositoryProvider.getProvider(resource.getProject(), SVNTeamPlugin.NATURE_ID);
SVNTeamProvider info = (SVNTeamProvider)RepositoryProvider.getProvider(resource.getProject(), SVNTeamPlugin.NATURE_ID);
if (info != null) {
try {
info.relocateResource();
......@@ -692,7 +692,7 @@ public class SVNRemoteStorage extends AbstractSVNStorage implements IRemoteStora
}
protected ILocalResource loadLocalResourcesSubTree(final IResource resource, int depth) throws Exception {
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(resource.getProject(), SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(resource.getProject(), SVNTeamPlugin.NATURE_ID);
if (provider == null || FileUtility.isSVNInternals(resource)) {
return this.wrapUnexistingResource(resource, IStateFilter.ST_INTERNAL_INVALID, 0);
}
......@@ -807,7 +807,7 @@ public class SVNRemoteStorage extends AbstractSVNStorage implements IRemoteStora
return false;
}
protected ILocalResource loadLocalResourcesSubTreeSVNImpl(IConnectedProjectInformation provider, IResource resource, int depth) throws Exception {
protected ILocalResource loadLocalResourcesSubTreeSVNImpl(SVNTeamProvider provider, IResource resource, int depth) throws Exception {
IProject project = resource.getProject();
IResource target = resource.getType() == IResource.FILE ? resource.getParent() : resource;
......
......@@ -52,9 +52,9 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.operation.IActionOperation;
import org.eclipse.team.svn.core.operation.local.GetAllResourcesOperation;
import org.eclipse.team.svn.core.resource.ILocalResource;
......@@ -660,7 +660,7 @@ public final class FileUtility {
public static boolean isConnected(IResource resource) {
if (resource.getProject() != null) {
RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
return provider != null && provider instanceof IConnectedProjectInformation;
return provider != null && provider instanceof SVNTeamProvider;
}
return false;
}
......
......@@ -18,8 +18,8 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.SVNTeamPlugin;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.extension.crashrecovery.ErrorDescription;
import org.eclipse.team.svn.core.extension.crashrecovery.IResolutionHelper;
import org.eclipse.team.svn.core.operation.IActionOperation;
......@@ -83,7 +83,7 @@ public class InaccessibleLocationDataHelper implements IResolutionHelper {
if (container == null) {
return false;
}
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
try {
provider.switchResource(container);
}
......
......@@ -17,8 +17,8 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.IConnectedProjectInformation;
import org.eclipse.team.svn.core.SVNTeamPlugin;
import org.eclipse.team.svn.core.SVNTeamProvider;
import org.eclipse.team.svn.core.extension.crashrecovery.ErrorDescription;
import org.eclipse.team.svn.core.extension.crashrecovery.IResolutionHelper;
import org.eclipse.team.svn.core.operation.CompositeOperation;
......@@ -53,7 +53,7 @@ public class RelocatedProjectHelper implements IResolutionHelper {
IRepositoryRoot []roots = SVNUtility.findRoots(relocatedTo, true);
if (roots.length != 0) {
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
try {
provider.switchResource(roots[0].asRepositoryContainer(relocatedTo, false));
return true;
......@@ -99,7 +99,7 @@ public class RelocatedProjectHelper implements IResolutionHelper {
protected void runImpl(IProgressMonitor monitor) throws Exception {
location.setUrl(relocatedTo);
location.setUrl(location.getRepositoryRootUrl());
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
provider.relocateResource();
}
});
......@@ -108,7 +108,7 @@ public class RelocatedProjectHelper implements IResolutionHelper {
protected void runImpl(IProgressMonitor monitor) throws Exception {
if (mainOp.getExecutionState() != IActionOperation.OK) {
SVNRemoteStorage.instance().copyRepositoryLocation(location, backup);
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
provider.relocateResource();
}
}
......@@ -121,7 +121,7 @@ public class RelocatedProjectHelper implements IResolutionHelper {
}
else if (panel.getRecoveryAction() == RelocationChoicesPanel.SHARE_WITH_ANOTHER_LOCATION) {
try {
IConnectedProjectInformation provider = (IConnectedProjectInformation)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNTeamPlugin.NATURE_ID);
IRepositoryLocation newLocation = SVNRemoteStorage.instance().newRepositoryLocation();
SVNRemoteStorage.instance().copyRepositoryLocation(newLocation, location);
newLocation.setUrl(relocatedTo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment