diff options
author | sminto | 2005-08-25 15:29:51 +0000 |
---|---|---|
committer | sminto | 2005-08-25 15:29:51 +0000 |
commit | ee630352fd53a458cb477f410e85cb37f65ab3d7 (patch) | |
tree | f4fb2be2f9d5bb18a1dedc6317bc15585a0b0436 | |
parent | 048967433712ec4ab6c0cb31652051b9ec8e913b (diff) | |
download | org.eclipse.mylyn.tasks-generic_query.tar.gz org.eclipse.mylyn.tasks-generic_query.tar.xz org.eclipse.mylyn.tasks-generic_query.zip |
finished with custom queriesgeneric_query
11 files changed, 233 insertions, 147 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml index 2f9682674..41a60e2ae 100644 --- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml +++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml @@ -141,18 +141,7 @@ toolbarPath="mylar" tooltip="Add Bugzilla Query"> </action> - - <action - class="org.eclipse.mylar.bugzilla.ui.actions.CreateCustomBugzillaQueryAction" - enablesFor="*" - icon="icons/etool16/category-query-new.gif" - id="org.eclipse.mylar.bugzilla.tasklist.addCustomQuery" - label="Add Custom Bugzilla Query" - style="push" - toolbarPath="mylar" - tooltip="Add Custom Bugzilla Query"> - </action> - + <action class="org.eclipse.mylar.bugzilla.ui.actions.CreateNewBugzillaTaskAction" enablesFor="*" diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaQueryCategoryAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaQueryCategoryAction.java index a065cf2ac..cc5055c65 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaQueryCategoryAction.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaQueryCategoryAction.java @@ -18,6 +18,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.mylar.bugzilla.ui.BugzillaImages; +import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaCustomQuery; import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaQueryCategory; import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaQueryDialog; import org.eclipse.mylar.core.MylarPlugin; @@ -51,8 +52,13 @@ public class CreateBugzillaQueryCategoryAction extends Action implements IViewAc // MylarPlugin.getDefault().actionObserved(this); BugzillaQueryDialog sqd = new BugzillaQueryDialog(Display.getCurrent().getActiveShell()); if(sqd.open() == Dialog.OK){ - // TODO make this work properly - final BugzillaQueryCategory queryCategory = new BugzillaQueryCategory(sqd.getName(), sqd.getUrl(), sqd.getMaxHits()); + + final BugzillaQueryCategory queryCategory; + if(!sqd.isCustom()){ + queryCategory = new BugzillaQueryCategory(sqd.getName(), sqd.getUrl(), sqd.getMaxHits()); + } else { + queryCategory = new BugzillaCustomQuery(sqd.getName(), sqd.getUrl(), sqd.getMaxHits()); + } MylarTasklistPlugin.getTaskListManager().addQuery(queryCategory); WorkspaceModifyOperation op = new WorkspaceModifyOperation() { diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateCustomBugzillaQueryAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateCustomBugzillaQueryAction.java deleted file mode 100644 index 0863db12d..000000000 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateCustomBugzillaQueryAction.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 - 2005 University Of British Columbia and others. - * 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: - * University Of British Columbia - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylar.bugzilla.ui.actions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.mylar.bugzilla.ui.BugzillaImages; -import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaCustomQuery; -import org.eclipse.mylar.core.MylarPlugin; -import org.eclipse.mylar.tasklist.MylarTasklistPlugin; -import org.eclipse.mylar.tasklist.ui.views.TaskListView; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.progress.IProgressService; - -/** - * @author Mik Kersten and Ken Sueda - */ -public class CreateCustomBugzillaQueryAction extends Action implements IViewActionDelegate { - - public static final String ID = "org.eclipse.mylar.tasklist.actions.create.bug.query"; - - public CreateCustomBugzillaQueryAction() { - setText("Add Custom Bugzilla Query"); - setToolTipText("Add Custom Bugzilla Query"); - setId(ID); - setImageDescriptor(BugzillaImages.CATEGORY_QUERY_NEW); - } - - @Override - public void run() { - - InputDialog d = new InputDialog(Display.getCurrent().getActiveShell(), "Name the query", "Name the query", "", null); - d.open(); - String name = d.getValue(); - - d = new InputDialog(Display.getCurrent().getActiveShell(), "MaxHits", "MaxHits", "", null); - d.open(); - String maxHits = d.getValue(); - - d = new InputDialog(Display.getCurrent().getActiveShell(), "URL", "URL", "", null); - d.open(); - String url = d.getValue(); - - // TODO make this work properly - final BugzillaCustomQuery queryCategory = new BugzillaCustomQuery(name, - url, maxHits); - - MylarTasklistPlugin.getTaskListManager().addQuery(queryCategory); - 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) { - MylarPlugin.log(e, - "There was a problem executing the query refresh"); - } - if (TaskListView.getDefault() != null) - TaskListView.getDefault().getViewer().refresh(); - - } - - public void init(IViewPart view) { - - } - - public void run(IAction action) { - run(); - } - - public void selectionChanged(IAction action, ISelection selection) { - - } -}
\ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaReportsAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaReportsAction.java index d9826bf0e..b7642a0e7 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaReportsAction.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaReportsAction.java @@ -146,13 +146,15 @@ public class RefreshBugzillaReportsAction extends Action implements IViewActionD } for (ICategory cat : MylarTasklistPlugin .getTaskListManager().getTaskList().getCategories()) { - if(cat.isArchive()) - continue; +// if(cat.isArchive()) +// continue; if (cat instanceof TaskCategory) { for (ITask task : ((TaskCategory) cat).getChildren()) { if (task instanceof BugzillaTask && !task.isCompleted()) { - BugzillaUiPlugin.getDefault().getBugzillaRefreshManager().addTaskToBeRefreshed((BugzillaTask)task); + if(BugzillaTask.getLastRefreshTimeInMinutes(((BugzillaTask)task).getLastRefresh()) > 2){ + BugzillaUiPlugin.getDefault().getBugzillaRefreshManager().addTaskToBeRefreshed((BugzillaTask)task); + } else System.out.println("skipped " + task.getHandle()); // ((BugzillaTask) task).refresh(); } } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaCustomQueryDialog.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaCustomQueryDialog.java new file mode 100644 index 000000000..0999d3314 --- /dev/null +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaCustomQueryDialog.java @@ -0,0 +1,92 @@ +package org.eclipse.mylar.bugzilla.ui.tasklist; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +public class BugzillaCustomQueryDialog extends Dialog { + private String url; + private String name = ""; + private String startingUrl = null; + private String maxHits; + private Text maxHitsText; + private Text nameText; + private Text queryText; + + public BugzillaCustomQueryDialog(Shell parentShell, String queryString, String description, String maxHits) { + super(parentShell); + this.startingUrl = queryString; + this.maxHits = maxHits; + this.name = description; + } + + public String getName() { + return name; + } + + public String getUrl() { + return url; + } + + public String getMaxHits() { + return maxHits; + } + + @Override + protected Control createContents(Composite parent) { + Composite custom = new Composite(parent, SWT.NONE); + GridLayout gl = new GridLayout(2, false); + custom.setLayout(gl); + + Label l = new Label(custom, SWT.NONE); + l.setText("Bugzilla Query Category Name"); + + nameText = new Text(custom, SWT.BORDER | SWT.SINGLE); + if(name != null) + nameText.setText(name); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 300; + nameText.setLayoutData(gd); + + l = new Label(custom, SWT.NONE); + l.setText("Max Hits Returned (-1 means all)"); + + maxHitsText = new Text(custom, SWT.BORDER | SWT.SINGLE); + if(maxHits != null) + maxHitsText.setText(maxHits); + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 300; + maxHitsText.setLayoutData(gd); + + l = new Label(custom, SWT.NONE); + l.setText("Query URL"); + + queryText = new Text(custom, SWT.BORDER | SWT.SINGLE); + if(startingUrl != null) + queryText.setText(startingUrl); + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 300; + queryText.setLayoutData(gd); + + + Control c = super.createContents(parent); + + return c; + } + + @Override + protected void okPressed(){ + // TODO validate the values + url = queryText.getText(); + name = nameText.getText(); + maxHits = maxHitsText.getText(); + super.okPressed(); + } + +} diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryDialog.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryDialog.java index e2cbe782d..1a26ad6fd 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryDialog.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaQueryDialog.java @@ -29,6 +29,7 @@ import org.eclipse.search.ui.ISearchPageContainer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -36,7 +37,9 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkingSet; /** @@ -50,8 +53,18 @@ public class BugzillaQueryDialog extends Dialog { private String startingUrl = null; private String maxHits; + private Text queryText; + private Button customButton; + private boolean isCustom = false; + + private boolean isNew = false; + + private boolean enabled = true; + public BugzillaQueryDialog(Shell parentShell) { super(parentShell); + isNew = true; + isCustom = false; searchOptionPage = new BugzillaSearchOptionPage(); } @@ -62,6 +75,7 @@ public class BugzillaQueryDialog extends Dialog { this.startingUrl = startingUrl; this.maxHits = maxHits; this.name = name; + isNew = false; } public String getName() { @@ -76,11 +90,50 @@ public class BugzillaQueryDialog extends Dialog { return maxHits; } + public boolean isCustom(){ + return isCustom; + } + @Override protected Control createContents(Composite parent) { + if(isNew){ + Group custom = new Group(parent, SWT.NONE); + GridLayout gl = new GridLayout(2, false); + custom.setLayout(gl); + + customButton = new Button(custom, SWT.CHECK); + customButton.setText("Custom Query"); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + customButton.setLayoutData(gd); + + Label l = new Label(custom, SWT.NONE); + + l = new Label(custom, SWT.NONE); + l.setText("Query URL"); + + queryText = new Text(custom, SWT.BORDER | SWT.SINGLE); + if(startingUrl != null) + queryText.setText(startingUrl); + } searchOptionPage.createControl(parent); + if(isNew){ + customButton.addSelectionListener(new SelectionListener(){ + + public void widgetSelected(SelectionEvent e) { + enabled = !enabled; + searchOptionPage.setControlsEnabled(enabled); + queryText.setEnabled(!enabled); + isCustom = customButton.getSelection(); + } + + + public void widgetDefaultSelected(SelectionEvent e) {} + }); + } + searchOptionPage.setVisible(true); + Control c = super.createContents(parent); if(startingUrl != null){ try{ @@ -89,12 +142,27 @@ public class BugzillaQueryDialog extends Dialog { // ignore, should never get this } } + + if(isNew){ + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 450; + queryText.setLayoutData(gd); + + customButton.setSelection(!enabled); + queryText.setEnabled(!enabled); + searchOptionPage.setControlsEnabled(enabled); + } + return c; } @Override protected void okPressed(){ - url = searchOptionPage.getSearchURL(); + if(customButton != null && customButton.getSelection()){ + url = queryText.getText(); + } else { + url = searchOptionPage.getSearchURL(); + } if(url == null || url.equals("")){ /* * Should never get here. Every implementation of the Java platform is required @@ -324,7 +392,33 @@ public class BugzillaQueryDialog extends Dialog { this.maxHits = maxHits; maxHitsText.setText(maxHits); } - + + public void setControlsEnabled(boolean enabled){ + summaryOperation.setEnabled(enabled); + product.setEnabled(enabled); + os.setEnabled(enabled); + hardware.setEnabled(enabled); + priority.setEnabled(enabled); + severity.setEnabled(enabled); + resolution.setEnabled(enabled); + status.setEnabled(enabled); + commentOperation.setEnabled(enabled); + commentPattern.setEnabled(enabled); + component.setEnabled(enabled); + version.setEnabled(enabled); + target.setEnabled(enabled); + emailOperation.setEnabled(enabled); + emailPattern.setEnabled(enabled); + for(Button b: emailButton){ + b.setEnabled(enabled); + } + saveButton.setEnabled(enabled); + loadButton.setEnabled(enabled); + updateButton.setEnabled(enabled); + summaryPattern.setEnabled(enabled); + daysText.setEnabled(enabled); + + } public String getSearchURL() { try{ diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java index 55ba1bf63..980f69761 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java @@ -344,14 +344,6 @@ public class BugzillaTask extends Task { } /** - * @return Returns the last time this task's bug report was downloaded from - * the server. - */ - public Date getLastRefreshTime() { - return lastRefresh; - } - - /** * @return The number of seconds ago that this task's bug report was * downloaded from the server. */ @@ -577,4 +569,11 @@ public class BugzillaTask extends Task { public String getStringForSortingDescription() { return getBugId(getHandle())+""; } + + public static long getLastRefreshTimeInMinutes(Date lastRefresh) { + Date timeNow = new Date(); + if (lastRefresh == null) lastRefresh = new Date(); + long timeDifference = (timeNow.getTime() - lastRefresh.getTime())/60000; + return timeDifference; + } } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java index 48e9e149c..b371e6e91 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java @@ -145,7 +145,7 @@ public class BugzillaTaskExternalizer extends DefaultTaskListExternalizer { BugzillaTask bt = (BugzillaTask) task; node.setAttribute(BUGZILLA, TRUE); if (bt.getLastRefresh() != null) { - node.setAttribute(LAST_DATE, new Long(bt.getLastRefreshTime() + node.setAttribute(LAST_DATE, new Long(bt.getLastRefresh() .getTime()).toString()); } else { node.setAttribute(LAST_DATE, new Long(new Date().getTime()).toString()); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java index 7246651e6..54dd6d013 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java @@ -16,7 +16,6 @@ import java.util.List; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; import org.eclipse.mylar.bugzilla.ui.BugzillaOpenStructure; @@ -107,27 +106,21 @@ public class BugzillaTaskHandler implements ITaskHandler { } else { // not supported } - }else if (element instanceof BugzillaCustomQuery){ + } else if(element instanceof BugzillaCustomQuery){ BugzillaCustomQuery queryCategory = (BugzillaCustomQuery)element; - - InputDialog d = new InputDialog(Display.getCurrent().getActiveShell(), "Name the query", "Name the query", queryCategory.getDescription(false), null); - d.open(); - queryCategory.setDescription(d.getValue()); - - d = new InputDialog(Display.getCurrent().getActiveShell(), "MaxHits", "MaxHits", queryCategory.getMaxHits()+"", null); - d.open(); - int maxHits = -1; - try{ - maxHits = Integer.parseInt(d.getValue()); - } catch(Exception e){} - queryCategory.setMaxHits(maxHits); - - d = new InputDialog(Display.getCurrent().getActiveShell(), "URL", "URL", queryCategory.getQueryString(), null); - d.open(); - queryCategory.setQueryString(d.getValue()); - new RefreshBugzillaAction(queryCategory).run(); - - } else if (element instanceof BugzillaQueryCategory){ + BugzillaCustomQueryDialog sqd = new BugzillaCustomQueryDialog(Display.getCurrent().getActiveShell(), queryCategory.getQueryString(), queryCategory.getDescription(false), queryCategory.getMaxHits()+""); + if(sqd.open() == Dialog.OK){ + queryCategory.setDescription(sqd.getName()); + queryCategory.setQueryString(sqd.getUrl()); + int maxHits = -1; + try{ + maxHits = Integer.parseInt(sqd.getMaxHits()); + } catch(Exception e){} + queryCategory.setMaxHits(maxHits); + + new RefreshBugzillaAction(queryCategory).run(); + } + }else if (element instanceof BugzillaQueryCategory){ BugzillaQueryCategory queryCategory = (BugzillaQueryCategory)element; BugzillaQueryDialog sqd = new BugzillaQueryDialog(Display.getCurrent().getActiveShell(), queryCategory.getQueryString(), queryCategory.getDescription(false), queryCategory.getMaxHits()+""); if(sqd.open() == Dialog.OK){ diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskPriorityFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskPriorityFilter.java index f964e26c2..7130964ef 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskPriorityFilter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskPriorityFilter.java @@ -35,6 +35,9 @@ public class TaskPriorityFilter implements ITaskFilter { if (element instanceof ITask && ((ITask)element).isActive()) { return true; } + if (!((ITaskListElement)element).getPriority().startsWith("P")) { + return true; + } if (priorityLevel.compareTo(((ITaskListElement)element).getPriority()) >= 0) { return true; } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java index 2f8aea521..e55e0da7f 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java @@ -77,7 +77,12 @@ public class PlanningGameSorter extends ViewerSorter { } private int compareCreationDate(ITask task1, ITask task2) { - return task2.getCreationDate().compareTo(task1.getCreationDate()); + if(task1.getCreationDate() == null) + return 1; + else if(task2.getCreationDate() == null) + return -1; + else + return task2.getCreationDate().compareTo(task1.getCreationDate()); } private int compareDuration(ITask task1, ITask task2) { |