diff options
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java | 62 |
1 files changed, 8 insertions, 54 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java index 196e95a6e..823014239 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryWizardPage.java @@ -11,26 +11,15 @@ package org.eclipse.mylar.bugzilla.ui.tasklist; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.mylar.core.util.MylarStatusHandler; -import org.eclipse.mylar.internal.tasklist.MylarTaskListPlugin; -import org.eclipse.mylar.internal.tasklist.MylarTaskListPrefConstants; -import org.eclipse.mylar.internal.tasklist.TaskRepositoryManager; -import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView; -import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractNewQueryPage; +import org.eclipse.jface.wizard.WizardPage; import org.eclipse.mylar.tasklist.TaskRepository; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.progress.IProgressService; +import org.eclipse.swt.widgets.Control; /** * @author Mik Kersten */ -public class BugzillaQueryWizardPage extends AbstractNewQueryPage { +public class BugzillaQueryWizardPage extends WizardPage { private static final String TITLE = "New Bugzilla Query"; @@ -46,46 +35,11 @@ public class BugzillaQueryWizardPage extends AbstractNewQueryPage { } public void createControl(Composite parent) { - queryDialog.createContents(parent); - setControl(parent); + Control control = queryDialog.createDialogArea(parent); + setControl(control); } - - @Override - public void addQuery() { - queryDialog.okPressed(); - - TaskRepository repository = queryDialog.getRepository(); - if (repository == null) { - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Mylar Bugzilla Client", - TaskRepositoryManager.MESSAGE_NO_REPOSITORY); - return; - } - - final BugzillaQueryCategory queryCategory; - if(!queryDialog.isCustom()){ - queryCategory = new BugzillaQueryCategory(repository.getUrl().toExternalForm(), queryDialog.getUrl(), queryDialog.getName(), queryDialog.getMaxHits()); - } else { - queryCategory = new BugzillaCustomQueryCategory(repository.getUrl().toExternalForm(), queryDialog.getName(), queryDialog.getUrl(), queryDialog.getMaxHits()); - } - MylarTaskListPlugin.getTaskListManager().addQuery(queryCategory); - boolean offline = MylarTaskListPlugin.getPrefs().getBoolean(MylarTaskListPrefConstants.WORK_OFFLINE); - if(!offline){ - WorkspaceModifyOperation op = new WorkspaceModifyOperation() { - protected void execute(IProgressMonitor monitor) throws CoreException { - queryCategory.refreshBugs(); - } - }; - - IProgressService service = PlatformUI.getWorkbench().getProgressService(); - try { - service.run(true, true, op); - } catch (Exception e) { - MylarStatusHandler.log(e, "There was a problem executing the query refresh"); - } - } - if(TaskListView.getDefault() != null) { - // TODO: remove - TaskListView.getDefault().getViewer().refresh(); - } + + public BugzillaQueryDialog getQueryDialog() { + return queryDialog; } } |