diff options
| author | Kevin Sawicki | 2011-04-14 17:11:18 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2011-04-14 20:43:22 +0000 |
| commit | ee044799233ffcb280aa4a027568631a215b693a (patch) | |
| tree | fba2a28f9aa1b3147b120c2d335faed94fa994e4 | |
| parent | 6cfe5ac660a4fcb89b310ade1342d0234af77a37 (diff) | |
| download | egit-github-ee044799233ffcb280aa4a027568631a215b693a.tar.gz egit-github-ee044799233ffcb280aa4a027568631a215b693a.tar.xz egit-github-ee044799233ffcb280aa4a027568631a215b693a.zip | |
Add initial gist task repository connector UI class
Change-Id: I0e4008a460c0b1284993ce040d02803d3e705191
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
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 00000000..a4891754 --- /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 6d376fe7..72efe13b 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 e513ffeb..d8490512 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 |
