summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-14 13:11:18 (EDT)
committer Chris Aniszczyk2011-04-14 16:43:22 (EDT)
commitee044799233ffcb280aa4a027568631a215b693a (patch)
treefba2a28f9aa1b3147b120c2d335faed94fa994e4
parent6cfe5ac660a4fcb89b310ade1342d0234af77a37 (diff)
downloadegit-github-ee044799233ffcb280aa4a027568631a215b693a.zip
egit-github-ee044799233ffcb280aa4a027568631a215b693a.tar.gz
egit-github-ee044799233ffcb280aa4a027568631a215b693a.tar.bz2
Add initial gist task repository connector UI classrefs/changes/16/3116/2
Change-Id: I0e4008a460c0b1284993ce040d02803d3e705191 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorUi.java99
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/Messages.java3
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/messages.properties1
3 files changed, 103 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorUi.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorUi.java
new file mode 100644
index 0000000..a489175
--- /dev/null
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorUi.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.internal.github.ui.gist;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.mylyn.internal.github.core.gist.GistConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITaskMapping;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage;
+import org.eclipse.mylyn.tasks.ui.wizards.ITaskSearchPage;
+import org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard;
+import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard;
+
+/**
+ * Gist repository connector user interface class.
+ */
+public class GistConnectorUi extends AbstractRepositoryConnectorUi {
+
+ /**
+ * Get core gist repository connector
+ *
+ * @return gist connector
+ */
+ public static GistConnector getCoreConnector() {
+ return (GistConnector) TasksUi
+ .getRepositoryConnector(GistConnector.KIND);
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getTaskKindLabel(org.eclipse.mylyn.tasks.core.ITask)
+ */
+ public String getTaskKindLabel(ITask task) {
+ return Messages.GistConnectorUi_LabelTaskKind;
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getConnectorKind()
+ */
+ public String getConnectorKind() {
+ return GistConnector.KIND;
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getSettingsPage(org.eclipse.mylyn.tasks.core.TaskRepository)
+ */
+ public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository) {
+ return new GistRepositorySettingsPage(taskRepository);
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getQueryWizard(org.eclipse.mylyn.tasks.core.TaskRepository,
+ * org.eclipse.mylyn.tasks.core.IRepositoryQuery)
+ */
+ public IWizard getQueryWizard(TaskRepository taskRepository,
+ IRepositoryQuery queryToEdit) {
+ RepositoryQueryWizard wizard = new RepositoryQueryWizard(taskRepository);
+ wizard.addPage(new GistRepositoryQueryPage(taskRepository, queryToEdit));
+ return wizard;
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getNewTaskWizard(org.eclipse.mylyn.tasks.core.TaskRepository,
+ * org.eclipse.mylyn.tasks.core.ITaskMapping)
+ */
+ public IWizard getNewTaskWizard(TaskRepository taskRepository,
+ ITaskMapping selection) {
+ return new NewTaskWizard(taskRepository, selection);
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#hasSearchPage()
+ */
+ public boolean hasSearchPage() {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi#getSearchPage(org.eclipse.mylyn.tasks.core.TaskRepository,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public ITaskSearchPage getSearchPage(TaskRepository repository,
+ IStructuredSelection selection) {
+ return new GistRepositoryQueryPage(repository, null);
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/Messages.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/Messages.java
index 6d376fe..72efe13 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/Messages.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/Messages.java
@@ -20,6 +20,9 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.github.ui.gist.messages"; //$NON-NLS-1$
/** */
+ public static String GistConnectorUi_LabelTaskKind;
+
+ /** */
public static String GistRepositoryQueryPage_LabelTitle;
/** */
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/messages.properties b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/messages.properties
index e513ffe..d849051 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/messages.properties
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/messages.properties
@@ -1,3 +1,4 @@
+GistConnectorUi_LabelTaskKind=Gist
GistRepositoryQueryPage_LabelTitle=Title:
GistRepositoryQueryPage_LabelUser=User:
GistRepositorySettingsPage_Description=Enter repository settings