Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Macguire2002-05-16 19:24:26 -0400
committerKevin Macguire2002-05-16 19:24:26 -0400
commit106c38e695353373726fbea3150438561a2d5a6b (patch)
treed31c4e2dfaea8dc12453e0b3945fbed08c491712
parentfb486b66a8e9356ccbdcd957810f9feb1b7318f2 (diff)
downloadeclipse.platform.team-106c38e695353373726fbea3150438561a2d5a6b.tar.gz
eclipse.platform.team-106c38e695353373726fbea3150438561a2d5a6b.tar.xz
eclipse.platform.team-106c38e695353373726fbea3150438561a2d5a6b.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/target/TargetManager.java24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetAction.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutAction.java7
3 files changed, 12 insertions, 26 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/target/TargetManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/target/TargetManager.java
index 737383c20..a23396de0 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/target/TargetManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/target/TargetManager.java
@@ -133,31 +133,15 @@ public class TargetManager {
}
}
- public static boolean hasProvider(IProject project) throws TeamException {
- try {
- ISynchronizer s = ResourcesPlugin.getWorkspace().getSynchronizer();
- byte[] mappingBytes = s.getSyncInfo(TARGET_MAPPINGS, project);
- if (mappingBytes == null) {
- return false;
- } else {
- LocationMapping mapping = new LocationMapping(mappingBytes);
- Site site =
- getSite(mapping.getType(), mapping.getURL());
- return site != null;
- }
- } catch (CoreException e) {
- throw new TeamException("Problems getting default target provider" + project.getName(), e);
- } catch (IOException e) {
- throw new TeamException("Problems getting default target provider" + project.getName(), e);
- }
+ public static Site getSite(String type, URL url) {
+ return getSite(type, url.toExternalForm());
}
-
- public static Site getSite(String type, URL id) {
+ public static Site getSite(String type, String urlID) {
for (Iterator it = sites.iterator(); it.hasNext();) {
Site element = (Site) it.next();
if (element.getType().equals(type)
- && element.getURL().equals(id)) {
+ && element.getURL().toExternalForm().equals(urlID)) {
return element;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetAction.java
index 495edb873..4d1e422c6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetAction.java
@@ -62,10 +62,11 @@ public class GetAction extends TeamAction { public void run(IAction action) {
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
try {
- if(!TargetManager.hasProvider(resource.getProject()))
- return false;
- if(!TargetManager.getProvider(resource.getProject()).canPut(resource))
+ TargetProvider provider = TargetManager.getProvider(resource.getProject());
+ if(provider == null)
return false;
+ if(! provider.canPut(resource))
+ return false; //if one can't don't allow for any
} catch (TeamException e) {
TeamPlugin.log(IStatus.ERROR, "Exception getting provider", e);
return false;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutAction.java
index 84ad4c34d..4c9e6b18f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutAction.java
@@ -65,10 +65,11 @@ public class PutAction extends TeamAction {
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
try {
- if(!TargetManager.hasProvider(resource.getProject()))
- return false;
- if(!TargetManager.getProvider(resource.getProject()).canGet(resource))
+ TargetProvider provider = TargetManager.getProvider(resource.getProject());
+ if(provider == null)
return false;
+ if(! provider.canGet(resource))
+ return false; //if one can't don't allow for any
} catch (TeamException e) {
TeamPlugin.log(IStatus.ERROR, "Exception getting provider", e);
return false;

Back to the top