diff options
author | Frank Becker | 2015-07-22 17:11:17 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2015-12-04 15:41:50 +0000 |
commit | 0db4f0fe1f7028115aa1fb7620818a821e16a4cf (patch) | |
tree | b63caa9b25b844f07cade663d664a9cb24fd91be /connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui | |
parent | 444fcccff52839d95667e5bf2f9a816e1c51af4f (diff) | |
download | org.eclipse.mylyn.tasks-0db4f0fe1f7028115aa1fb7620818a821e16a4cf.tar.gz org.eclipse.mylyn.tasks-0db4f0fe1f7028115aa1fb7620818a821e16a4cf.tar.xz org.eclipse.mylyn.tasks-0db4f0fe1f7028115aa1fb7620818a821e16a4cf.zip |
414360: create example for schema for QueryPage (provisional version)
Change-Id: I5a27b0198772d47941fa32906fdfdc3e63c97956
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=414360
Diffstat (limited to 'connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui')
-rw-r--r-- | connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java index 9c83fff9c..f3cd48ce7 100644 --- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java +++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java @@ -12,14 +12,20 @@ package org.eclipse.mylyn.internal.bugzilla.rest.ui; import org.eclipse.jface.wizard.IWizard; +import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConnector; import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestCore; +import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestTaskAttributeMapper; +import org.eclipse.mylyn.internal.provisional.bugzilla.rest.ui.BugzillaRestQueryTypeWizardPage; +import org.eclipse.mylyn.internal.provisional.bugzilla.rest.ui.BugzillaRestUiUtil; import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; import org.eclipse.mylyn.tasks.core.IRepositoryQuery; import org.eclipse.mylyn.tasks.core.ITaskMapping; import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.eclipse.mylyn.tasks.core.data.TaskData; import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage; import org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard; +import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard; public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnectorUi { @@ -42,8 +48,30 @@ public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnect @Override public IWizard getQueryWizard(TaskRepository repository, IRepositoryQuery query) { - // ignore - return null; + RepositoryQueryWizard wizard = new RepositoryQueryWizard(repository); + AbstractRepositoryConnector connector = getConnector(); + BugzillaRestConnector connectorREST = (BugzillaRestConnector) connector; + + TaskData taskData = new TaskData(new BugzillaRestTaskAttributeMapper(repository, connectorREST), + repository.getConnectorKind(), "Query", "Query"); + + if (query == null) { + wizard.addPage(new BugzillaRestQueryTypeWizardPage(repository, connector)); + } else { + if (isCustomQuery(query)) { + wizard.addPage(BugzillaRestUiUtil.createBugzillaRestSearchPage(true, true, taskData, connectorREST, + repository, query)); + } else { + wizard.addPage(BugzillaRestUiUtil.createBugzillaRestSearchPage(false, true, taskData, connectorREST, + repository, query)); + } + } + return wizard; + } + + private boolean isCustomQuery(IRepositoryQuery query2) { + String custom = query2.getAttribute("SimpleURLQueryPage"); + return custom != null && custom.equals(Boolean.TRUE.toString()); } @Override @@ -53,8 +81,7 @@ public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnect @Override public boolean hasSearchPage() { - // ignore - return false; + return true; } } |