Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2011-02-21 12:07:52 -0500
committerTomasz Zarna2011-02-21 12:07:52 -0500
commitdab851bbc39f6c45083c9810c94d12b3df967973 (patch)
tree6c10d2beca4968827ff95f3e0dc301cdbe4b81f1
parent712b46d034ebd6e303fc96ae78097047f18e4815 (diff)
downloadeclipse.platform.team-branch_20110112_bug330490.tar.gz
eclipse.platform.team-branch_20110112_bug330490.tar.xz
eclipse.platform.team-branch_20110112_bug330490.zip
bug 330490: API and UI to configure SCM URLs for import -- minor changesbranch_20110112_bug330490
-rw-r--r--bundles/org.eclipse.team.core/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.team.core/plugin.properties2
-rw-r--r--bundles/org.eclipse.team.core/plugin.xml2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java12
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/BundleImporterDelegate.java36
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporter.java11
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java55
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java8
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/importing/BundleImporterExtension.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/plugin.properties2
-rw-r--r--bundles/org.eclipse.team.cvs.core/plugin.xml2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CvsBundleImporterDelegate.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java17
-rw-r--r--bundles/org.eclipse.team.ui/schema/scmUrlImportPages.exsd2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IScmUrlImportWizardPage.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java7
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java14
19 files changed, 117 insertions, 95 deletions
diff --git a/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
index a5bb7b70e..ab881c525 100644
--- a/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.core/META-INF/MANIFEST.MF
@@ -11,7 +11,7 @@ Export-Package: org.eclipse.team.core,
org.eclipse.team.core.diff.provider,
org.eclipse.team.core.history,
org.eclipse.team.core.history.provider,
- org.eclipse.team.core.importing.provisional;x-friends:="org.eclipse.pde.core",
+ org.eclipse.team.core.importing.provisional;x-friends:="org.eclipse.pde.core,org.eclipse.team.cvs.core",
org.eclipse.team.core.mapping,
org.eclipse.team.core.mapping.provider,
org.eclipse.team.core.subscribers,
@@ -19,7 +19,6 @@ Export-Package: org.eclipse.team.core,
org.eclipse.team.core.variants,
org.eclipse.team.internal.core;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
org.eclipse.team.internal.core.history;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
- org.eclipse.team.internal.core.importing;x-friends:="org.eclipse.pde.core",
org.eclipse.team.internal.core.mapping;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
org.eclipse.team.internal.core.streams;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui",
org.eclipse.team.internal.core.subscribers;x-friends:="org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui"
diff --git a/bundles/org.eclipse.team.core/plugin.properties b/bundles/org.eclipse.team.core/plugin.properties
index 5fd317343..3308088de 100644
--- a/bundles/org.eclipse.team.core/plugin.properties
+++ b/bundles/org.eclipse.team.core/plugin.properties
@@ -18,4 +18,4 @@ Repository=Repository Providers
DefaultValidator=Default File Modification Validator
StorageMergers = Storage Mergers
-expoint.bundleImporters.name = Bundle Importers \ No newline at end of file
+BundleImporters = Bundle Importers \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/plugin.xml b/bundles/org.eclipse.team.core/plugin.xml
index b7bf6fccb..fc240b259 100644
--- a/bundles/org.eclipse.team.core/plugin.xml
+++ b/bundles/org.eclipse.team.core/plugin.xml
@@ -8,7 +8,7 @@
<extension-point id="repository" name="%Repository" schema="schema/repository.exsd"/>
<extension-point id="defaultFileModificationValidator" name="%DefaultValidator" schema="schema/defaultFileModificationValidator.exsd"/>
<extension-point id="storageMergers" name="%StorageMergers" schema="schema/storageMergers.exsd"/>
- <extension-point id="bundleImporters" name="%expoint.bundleImporters.name" schema="schema/bundleImporters.exsd"/>
+ <extension-point id="bundleImporters" name="%BundleImporters" schema="schema/bundleImporters.exsd"/>
<!-- Define common known file types -->
<extension
point="org.eclipse.team.core.fileTypes">
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
index 43f6965e6..188d28588 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
@@ -65,7 +65,7 @@ public final class Team {
private final static FileContentManager fFileContentManager;
- private static List fProjectFactories;
+ private static List fBundleImporters;
static {
fFileContentManager= new FileContentManager();
@@ -527,7 +527,7 @@ public final class Team {
public IStorageMerger createStorageMerger(String extension) {
return createMerger(extension);
}
-
+
/**
* Returns the available bundle importers.
*
@@ -542,16 +542,16 @@ public final class Team {
* @since 3.6
*/
public synchronized static IBundleImporter[] getBundleImporters() {
- if (fProjectFactories == null) {
- fProjectFactories = new ArrayList();
+ if (fBundleImporters == null) {
+ fBundleImporters = new ArrayList();
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(TeamPlugin.EXTENSION_POINT_BUNDLE_IMPORTERS);
if (point != null) {
IConfigurationElement[] infos = point.getConfigurationElements();
for (int i = 0; i < infos.length; i++) {
- fProjectFactories.add(new BundleImporterExtension(infos[i]));
+ fBundleImporters.add(new BundleImporterExtension(infos[i]));
}
}
}
- return (IBundleImporter[]) fProjectFactories.toArray(new IBundleImporter[fProjectFactories.size()]);
+ return (IBundleImporter[]) fBundleImporters.toArray(new IBundleImporter[fBundleImporters.size()]);
}
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/BundleImporterDelegate.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/BundleImporterDelegate.java
index 0cc192dc6..64805d6a7 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/BundleImporterDelegate.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/BundleImporterDelegate.java
@@ -21,12 +21,20 @@ import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
/**
- * Abstract implementation of {@link IBundleImporterDelegate} that can be subclassed by
- * clients.
+ * Abstract implementation of {@link IBundleImporterDelegate}. It is recommended
+ * to subclass this class rather than implementing IBundleImporterDelegate
+ * directly when providing importer delegates.
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This interface has been added as part of a
+ * work in progress. There is no guarantee that this API will work or that it
+ * will remain the same. Please do not use this API without consulting with the
+ * Team team.
+ * </p>
+ *
+ * @since 3.6
*/
public abstract class BundleImporterDelegate implements IBundleImporterDelegate {
- //private static final String ATTR_TAG = "tag"; //$NON-NLS-1$
private static final String ATTR_PROJECT = "project"; //$NON-NLS-1$
public static final String ECLIPSE_SOURCE_REFERENCES = "Eclipse-SourceReferences"; //$NON-NLS-1$
@@ -78,21 +86,19 @@ public abstract class BundleImporterDelegate implements IBundleImporterDelegate
public IProject[] performImport(ScmUrlImportDescription[] descriptions, IProgressMonitor monitor) throws CoreException {
List references = new ArrayList();
ProjectSetCapability psfCapability = getProviderType().getProjectSetCapability();
- // collect and validate all header values
- for (int i = 0; i < descriptions.length; i++) {
- ScmUrlImportDescription description = (ScmUrlImportDescription) descriptions[i];
- references.add(psfCapability.asReference(description.getUri(), description.getProject()));
- }
- // create projects
IProject[] result = null;
- if (!references.isEmpty()) {
- SubMonitor subMonitor = SubMonitor.convert(monitor, references.size());
- if (psfCapability != null) {
+ if (psfCapability != null) {
+ // collect and validate all header values
+ for (int i = 0; i < descriptions.length; i++) {
+ ScmUrlImportDescription description = (ScmUrlImportDescription) descriptions[i];
+ references.add(psfCapability.asReference(description.getUri(), description.getProject()));
+ }
+ // create projects
+ if (!references.isEmpty()) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, references.size());
result = psfCapability.addToWorkspace((String[]) references.toArray(new String[references.size()]), new ProjectSetSerializationContext(), subMonitor);
- } else {
- //TODO: error
+ subMonitor.done();
}
- subMonitor.done();
}
return result;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporter.java
index 3269706e4..d370fbe2f 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporter.java
@@ -20,11 +20,12 @@ package org.eclipse.team.core.importing.provisional;
* {@link IBundleImporterDelegate}.
* </p>
* <p>
- * <strong>EXPERIMENTAL</strong>. This interface has been added as
- * part of a work in progress. There is no guarantee that this API will
- * work or that it will remain the same. Please do not use this API without
- * consulting with the Team team.
- * </p>
+ * <strong>EXPERIMENTAL</strong>. This interface has been added as part of a
+ * work in progress. There is no guarantee that this API will work or that it
+ * will remain the same. Please do not use this API without consulting with the
+ * Team team.
+ * </p>
+ *
* @since 3.6
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
index b895475db..38eb22531 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/importing/provisional/IBundleImporterDelegate.java
@@ -11,16 +11,19 @@
package org.eclipse.team.core.importing.provisional;
import java.util.Map;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ScmUrlImportDescription;
/**
- * A bundle importer delegate is contributed by a bundle importer extension and is capable
- * of importing projects into the workspace from a repository based on bundle manifest entries.
+ * A bundle importer delegate is contributed by a bundle importer extension and
+ * is capable of importing projects into the workspace from a repository based
+ * on bundle manifest entries.
* <p>
* Following is an example extension:
+ *
* <pre>
* &lt;extension point=&quot;org.eclipse.team.core.bundleImporters&quot;&gt;
* &lt;importer
@@ -29,40 +32,52 @@ import org.eclipse.team.core.ScmUrlImportDescription;
* &lt;/importer&gt;
* &lt;/extension&gt;
* </pre>
+ *
* </p>
* <p>
- * Clients contributing bundle importer extensions are intended to implement this interface.
- * They can also subclass {@link BundleImporterDelegate}.
+ * Clients contributing bundle importer extensions are intended to implement
+ * this interface. They can also subclass {@link BundleImporterDelegate}.
* </p>
* <p>
- * <strong>EXPERIMENTAL</strong>. This interface has been added as
- * part of a work in progress. There is no guarantee that this API will
- * work or that it will remain the same. Please do not use this API without
- * consulting with the Team team.
+ * <strong>EXPERIMENTAL</strong>. This interface has been added as part of a
+ * work in progress. There is no guarantee that this API will work or that it
+ * will remain the same. Please do not use this API without consulting with the
+ * Team team.
* </p>
+ *
* @since 3.6
* @noextend This interface is not intended to be extended by clients.
*/
public interface IBundleImporterDelegate {
/**
- * Returns an array of objects describing how each given bundle (manifest headers and values)
- * can be imported into a workspace project. A <code>null</code> entry in the returned array
- * indicates the corresponding bundle cannot be imported by this delegate.
+ * Returns an array of objects describing how each given bundle (manifest
+ * headers and values) can be imported into a workspace project. A
+ * <code>null</code> entry in the returned array indicates the corresponding
+ * bundle cannot be imported by this delegate.
*
- * @param manifests array of maps containing manifest headers and values of the associated bundles
- * @return array of bundle import descriptions that may contain <code>null</code> entries
+ * @param manifests
+ * array of maps containing manifest headers and values of the
+ * associated bundles
+ * @return array of bundle import descriptions that may contain
+ * <code>null</code> entries
*/
public ScmUrlImportDescription[] validateImport(Map[] manifests);
/**
- * Imports bundles into the workspace creating a project for each import description.
- * Reports progress to the given monitor, if not <code>null</code>.
+ * Imports bundles into the workspace creating a project for each import
+ * description. Reports progress to the given monitor, if not
+ * <code>null</code>.
*
- * @param descriptions description of bundles to import
- * @param monitor progress monitor or <code>null</code>
- * @return collection of projects created in the workspace or <code>null</code> if none
- * @throws CoreException if unable to import projects
+ * @param descriptions
+ * description of bundles to import
+ * @param monitor
+ * progress monitor or <code>null</code>
+ * @return collection of projects created in the workspace or
+ * <code>null</code> if none
+ * @throws CoreException
+ * if unable to import projects
*/
- public IProject[] performImport(ScmUrlImportDescription[] descriptions, IProgressMonitor monitor) throws CoreException;
+ public IProject[] performImport(ScmUrlImportDescription[] descriptions,
+ IProgressMonitor monitor) throws CoreException;
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
index 67910012a..aa898e74f 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java
@@ -55,10 +55,10 @@ final public class TeamPlugin extends Plugin {
// The id used to associate a provider with a project
public final static QualifiedName PROVIDER_PROP_KEY =
new QualifiedName("org.eclipse.team.core", "repository"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // The id for the Bundle Import extension point
- public static final String EXTENSION_POINT_BUNDLE_IMPORTERS = ID + ".bundleImporters"; //$NON-NLS-1$
-
+
+ // The id for the Bundle Import extension point
+ public static final String EXTENSION_POINT_BUNDLE_IMPORTERS = ID + ".bundleImporters"; //$NON-NLS-1$
+
// The one and only plug-in instance
private static TeamPlugin plugin;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/importing/BundleImporterExtension.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/importing/BundleImporterExtension.java
index 2cdfd2850..eb27bb5fc 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/importing/BundleImporterExtension.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/importing/BundleImporterExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2011 IBM Corporation and others.
+ * Copyright (c) 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.properties b/bundles/org.eclipse.team.cvs.core/plugin.properties
index 2c07ce7a8..2dc99eecf 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.core/plugin.properties
@@ -17,4 +17,4 @@ Authenticator=Authenticator
ConnectionMethods=ConnectionMethods
FileModificationValidator=FileModificationValidator
ChangeSets=Change Sets
-bundleImporter.cvs = CVS Bundle Importer
+cvsBundleImporter = CVS Bundle Importer
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml
index c44bf3a35..16f174ede 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.core/plugin.xml
@@ -243,7 +243,7 @@
point="org.eclipse.team.core.bundleImporters">
<importer
class="org.eclipse.team.internal.ccvs.core.CvsBundleImporterDelegate"
- name="%bundleImporter.cvs"
+ name="%cvsBundleImporter"
id="org.eclipse.team.core.cvs.importer">
</importer>
</extension>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CvsBundleImporterDelegate.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CvsBundleImporterDelegate.java
index c58ce2015..e4301a81e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CvsBundleImporterDelegate.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CvsBundleImporterDelegate.java
@@ -51,7 +51,7 @@ public class CvsBundleImporterDelegate extends BundleImporterDelegate {
protected RepositoryProviderType getProviderType() {
if (providerType == null)
- providerType = RepositoryProviderType.getProviderType("org.eclipse.team.cvs.core.cvsnature"); //$NON-NLS-1$
+ providerType = RepositoryProviderType.getProviderType(CVSProviderPlugin.getTypeId());
return providerType;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
index 7d36a5879..8554f87c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1192,6 +1192,4 @@ public class CVSUIMessages extends NLS {
public static String CVSScmUrlImportWizardPage_2;
public static String CVSScmUrlImportWizardPage_3;
public static String CVSScmUrlImportWizardPage_4;
-
-
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index e9c7cd0e4..f453580c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -1214,10 +1214,4 @@ CVSScmUrlImportWizardPage_0=Import Projects from CVS
CVSScmUrlImportWizardPage_1=Import CVS projects corresponding to plug-ins and fragments in the file system.
CVSScmUrlImportWizardPage_2=Import from &HEAD
CVSScmUrlImportWizardPage_3=Import specific &version(s) shown below
-CVSScmUrlImportWizardPage_4=Total: {0}
-
-CVSScmUrlImportWizardPage_0=Import Projects from CVS
-CVSScmUrlImportWizardPage_1=Import CVS projects corresponding to plug-ins and fragments in the file system.
-CVSScmUrlImportWizardPage_2=Import from &HEAD
-CVSScmUrlImportWizardPage_3=Import specific &version(s) shown below
-CVSScmUrlImportWizardPage_4=Total: {0}
+CVSScmUrlImportWizardPage_4=Total: {0} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
index 27cf75d57..6533c5464 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSScmUrlImportWizardPage.java
@@ -161,8 +161,8 @@ public class CVSScmUrlImportWizardPage extends WizardPage implements IScmUrlImpo
updateCount();
}
- // TODO:
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.CVS_SCM_URL_IMPORT_PAGE);
+ // TODO: add help
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.CVS_SCM_URL_IMPORT_PAGE);
}
/* (non-Javadoc)
@@ -227,7 +227,14 @@ public class CVSScmUrlImportWizardPage extends WizardPage implements IScmUrlImpo
return CVSURI.fromUri(scmUri).getTag().getName();
}
- // TODO: move to CVSURI
+ /**
+ * Remove tag attributes from the given URI reference. Results in the URI
+ * pointing to HEAD.
+ *
+ * @param scmUri
+ * a SCM URI reference to modify
+ * @return Returns the content of the stripped URI as a string.
+ */
private static String removeTag(URI scmUri) {
StringBuffer sb = new StringBuffer();
sb.append(scmUri.getScheme()).append(':');
@@ -239,9 +246,9 @@ public class CVSScmUrlImportWizardPage extends WizardPage implements IScmUrlImpo
for (int k = 0; k < params.length; k++) {
// PDE way of providing tags
if (params[k].startsWith("tag=")) { //$NON-NLS-1$
- // remove
+ // ignore
} else if (params[k].startsWith("version=")) { //$NON-NLS-1$
- // remove
+ // ignore
} else {
sb.append(params[k]);
}
diff --git a/bundles/org.eclipse.team.ui/schema/scmUrlImportPages.exsd b/bundles/org.eclipse.team.ui/schema/scmUrlImportPages.exsd
index 7ba8e186c..e36c5dde6 100644
--- a/bundles/org.eclipse.team.ui/schema/scmUrlImportPages.exsd
+++ b/bundles/org.eclipse.team.ui/schema/scmUrlImportPages.exsd
@@ -13,8 +13,6 @@ This extension point is used to register a page to import projects basing on the
&lt;p&gt;
Providers may provide an extension for this extension point, and an implementation of &lt;samp&gt;org.eclipse.team.ui.IScmUrlImportWizardPage&lt;/samp&gt; which allows to set and retrive project import descriptions.
&lt;/p&gt;
-
-
</documentation>
</annotation>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IScmUrlImportWizardPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IScmUrlImportWizardPage.java
index bd01dec6a..ad8fc4cd5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IScmUrlImportWizardPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IScmUrlImportWizardPage.java
@@ -18,8 +18,8 @@ import org.eclipse.team.core.ScmUrlImportDescription;
* IScmUrlImportWizardPage defines the interface that users of the extension
* point <code>org.eclipse.team.ui.scmUrlImportPages</code> must implement.
*
- * <strong>EXPERIMENTAL</strong>. This class has been added as part of a work
- * in progress. There is no guarantee that this API will work or that it will
+ * <strong>EXPERIMENTAL</strong>. This class has been added as part of a work in
+ * progress. There is no guarantee that this API will work or that it will
* remain the same. Please do not use this API without consulting with the Team
* team.
*
@@ -32,7 +32,9 @@ public interface IScmUrlImportWizardPage extends IWizardPage {
public static final String ATT_REPOSITORY = "repository"; //$NON-NLS-1$
/**
- * TODO:
+ * Called when the import wizard is closed by selecting the finish button.
+ * Implementers may store the page result (new/changed bundle import
+ * descriptions in getSelection) here.
*
* @return if the operation was successful. The wizard will only close when
* <code>true</code> is returned.
@@ -50,9 +52,9 @@ public interface IScmUrlImportWizardPage extends IWizardPage {
public ScmUrlImportDescription[] getSelection();
/**
- * Sets the import descriptions to be edited on the page.
- * The passed descriptions can be edited and should be
- * returned in {@link #getSelection()}.
+ * Sets the import descriptions to be edited on the page. The passed
+ * descriptions can be edited and should be returned in
+ * {@link #getSelection()}.
*
* @param descriptions
* the SCM URLs descriptions edited on the page.
@@ -60,14 +62,17 @@ public interface IScmUrlImportWizardPage extends IWizardPage {
public void setSelection(ScmUrlImportDescription[] descriptions);
/**
- * TODO:
+ * Sets the RepositoryProviderType for the page.
+ *
* @param provider
+ * to set
*/
public void setProvider(RepositoryProviderType provider);
/**
- * TODO:
- * @return provider
+ * Return the RepositoryProviderType associated with the page.
+ *
+ * @return a RepositoryProviderType for the current page
*/
public RepositoryProviderType getProvider();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
index 48936a549..c175e9a70 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUI.java
@@ -186,17 +186,16 @@ public class TeamUI {
if (ext instanceof IScmUrlImportWizardPage) {
IScmUrlImportWizardPage page = (IScmUrlImportWizardPage) ext;
page.setProvider(providerType);
-
- Set/*<ScmUrlImportDescription>*/ d = new HashSet();
+ Set/*<ScmUrlImportDescription>*/ set = new HashSet();
for (Iterator iterator = schemeUris.iterator(); iterator.hasNext();) {
URI uri = (URI) iterator.next();
for (int j = 0; j < descriptions.length; j++) {
if (descriptions[j].getUri().equals(uri)) {
- d.add(descriptions[j]);
+ set.add(descriptions[j]);
}
}
}
- page.setSelection((ScmUrlImportDescription[]) d.toArray(new ScmUrlImportDescription[0]));
+ page.setSelection((ScmUrlImportDescription[]) set.toArray(new ScmUrlImportDescription[0]));
pages.add(page);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
index cfc7237d5..913538e86 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ProjectSetImporterTests.java
@@ -232,7 +232,7 @@ public class ProjectSetImporterTests extends EclipseTest {
new ProjectSetSerializationContext(), null);
// If we got here and no NPE was thrown, we're good.
}
-
+
public void testScmUrlImport() throws TeamException, CoreException {
IProject project = createProject("ProjectSetImporterTests-testScmUrlImport", new String[0]);
project.delete(true, true, null);
@@ -254,7 +254,7 @@ public class ProjectSetImporterTests extends EclipseTest {
c.addToWorkspace((String[]) references.toArray(new String[references.size()]), new ProjectSetSerializationContext(), null);
assertExistsInWorkspace(project);
}
-
+
public void testScmUrlImportWithName() throws TeamException, CoreException {
IProject project = createProject("ProjectSetImporterTests-testScmUrlImportWithName", new String[0]);
project.delete(true, true, null);
@@ -277,7 +277,7 @@ public class ProjectSetImporterTests extends EclipseTest {
IProject project1 = ResourcesPlugin.getWorkspace().getRoot().getProject("project1");
assertExistsInWorkspace(project1);
}
-
+
public void testScmUrlImportWithTag() throws TeamException, CoreException, IOException {
IProject project = createProject("ProjectSetImporterTests-testScmUrlImportWithTag", new String[0]);
tagProject(project, new CVSTag("tag", CVSTag.VERSION), false);
@@ -288,7 +288,7 @@ public class ProjectSetImporterTests extends EclipseTest {
ScmUrlImportDescription d = new ScmUrlImportDescription(s, project.getName());
final IScmUrlImportWizardPage[] pages = TeamUI.getPages(new ScmUrlImportDescription[] {d});
assertEquals(1, pages.length);
-
+
assertTrue(pages[0] instanceof CVSScmUrlImportWizardPage);
Wizard wizard = new Wizard() {
public boolean performFinish() {
@@ -306,12 +306,12 @@ public class ProjectSetImporterTests extends EclipseTest {
useHead.setSelection(true);
wizard.performFinish();
wizardDialog.close();
-
+
// altered selection, check out from HEAD
ScmUrlImportDescription[] selection = pages[0].getSelection();
IBundleImporter cvsBundleImporter = Team.getBundleImporters()[0];
cvsBundleImporter.performImport(selection, null);
-
+
assertExistsInWorkspace(project);
IProject copy = checkoutCopy(project, CVSTag.DEFAULT);
// expecting the project to be checked out from HEAD
@@ -329,7 +329,7 @@ public class ProjectSetImporterTests extends EclipseTest {
}
// CVS Bundle Importer should be available
assertNotNull(cvsBundleImporter);
-
+
IProject project = createProject("ProjectSetImporterTests-testCvsBundleImporter", new String[0]);
project.delete(true, true, null);
ensureDoesNotExistInWorkspace(project);

Back to the top