Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-01-30 23:10:03 +0000
committerGerrit Code Review @ Eclipse.org2012-01-30 23:10:03 +0000
commite7ed54b982c1c5e69de85d1d70a94c63e093864e (patch)
treeb9a7ac7cbfb9fcc57388055c691477a89e1e3467
parent319274e83d11e9b6ed8d8892cad25093bb7e0090 (diff)
parentc1f3a09f0a9f9e59a433041bdc50def029c24fdb (diff)
downloadegit-github-e7ed54b982c1c5e69de85d1d70a94c63e093864e.tar.gz
egit-github-e7ed54b982c1c5e69de85d1d70a94c63e093864e.tar.xz
egit-github-e7ed54b982c1c5e69de85d1d70a94c63e093864e.zip
Merge "Add the RepositorySearchWizardPage to the EGit import wizard" into stable-1.3
-rw-r--r--org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.github.ui/plugin.xml11
-rw-r--r--[-rwxr-xr-x]org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java26
3 files changed, 35 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
index e9f08270..4a22e8ea 100644
--- a/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
@@ -36,6 +36,7 @@ Import-Package: org.eclipse.egit.core;version="[1.3.0,1.4.0)",
org.eclipse.egit.ui.internal.branch;version="[1.3.0,1.4.0)",
org.eclipse.egit.ui.internal.commit;version="[1.3.0,1.4.0)",
org.eclipse.egit.ui.internal.fetch;version="[1.3.0,1.4.0)",
+ org.eclipse.egit.ui.internal.provisional.wizards;version="[1.3.0,1.4.0)",
org.eclipse.egit.ui.internal.pull;version="[1.3.0,1.4.0)",
org.eclipse.jgit.errors;version="[1.3.0,1.4.0)",
org.eclipse.jgit.lib;version="[1.3.0,1.4.0)",
diff --git a/org.eclipse.mylyn.github.ui/plugin.xml b/org.eclipse.mylyn.github.ui/plugin.xml
index 2dd024ea..724ec315 100644
--- a/org.eclipse.mylyn.github.ui/plugin.xml
+++ b/org.eclipse.mylyn.github.ui/plugin.xml
@@ -295,4 +295,15 @@
icon="platform:/plugin/org.eclipse.egit.ui/icons/obj16/rebase.gif">
</image>
</extension>
+ <extension
+ point="org.eclipse.egit.ui.cloneSourceProvider">
+ <source
+ hasFixLocation="true"
+ icon="icons/obj16/github.png"
+ label="%githubMenuLabel">
+ </source>
+ <repositorySearchPage
+ class="org.eclipse.mylyn.internal.github.ui.RepositorySearchWizardPage">
+ </repositorySearchPage>
+ </extension>
</plugin>
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
index 7fae81f4..fe92cf35 100755..100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
@@ -18,12 +18,16 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.github.core.Language;
+import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.SearchRepository;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.client.IGitHubConstants;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.eclipse.egit.github.core.util.UrlUtils;
import org.eclipse.egit.ui.UIIcons;
+import org.eclipse.egit.ui.internal.provisional.wizards.GitRepositoryInfo;
+import org.eclipse.egit.ui.internal.provisional.wizards.IRepositorySearchResult;
+import org.eclipse.egit.ui.internal.provisional.wizards.NoRepositoryInfoException;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -39,6 +43,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.mylyn.internal.github.core.GitHub;
import org.eclipse.mylyn.internal.github.core.GitHubException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -56,7 +61,8 @@ import org.eclipse.ui.PlatformUI;
/**
* Search for GitHub repositories wizard page.
*/
-public class RepositorySearchWizardPage extends WizardPage {
+@SuppressWarnings("restriction")
+public class RepositorySearchWizardPage extends WizardPage implements IRepositorySearchResult {
private SearchRepository[] repositories = null;
@@ -69,9 +75,9 @@ public class RepositorySearchWizardPage extends WizardPage {
private Text searchText;
/**
- *
+ *
*/
- protected RepositorySearchWizardPage() {
+ public RepositorySearchWizardPage() {
super("repoSearchPage", Messages.RepositorySearchWizardPage_Title, null); //$NON-NLS-1$
setDescription(Messages.RepositorySearchWizardPage_Description);
setPageComplete(false);
@@ -285,4 +291,18 @@ public class RepositorySearchWizardPage extends WizardPage {
GitHubUi.logError(e);
}
}
+
+ public GitRepositoryInfo getGitRepositoryInfo() throws NoRepositoryInfoException {
+ GitHubClient client = GitHub
+ .configureClient(new GitHubClient());
+ RepositoryService service = new RepositoryService(client);
+ String cloneUrl = null;
+ try {
+ Repository fullRepo = service.getRepository(repositories[0]);
+ cloneUrl = fullRepo.getCloneUrl();
+ } catch (IOException e) {
+ throw new NoRepositoryInfoException(e.getMessage(), e);
+ }
+ return new GitRepositoryInfo(cloneUrl);
+ }
}

Back to the top