Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-13 20:29:19 -0400
committermkersten2005-07-13 20:29:19 -0400
commit261c304f5cd46cdf6a3d53a8182763443ab69dc3 (patch)
tree7fd273fe49c9966bff3a355e2c017fb80f0f90fa /org.eclipse.mylyn.tasks.ui
parent35389562b8be0a05c2d3bb3e7062b6524e48ad3a (diff)
downloadorg.eclipse.mylyn.tasks-261c304f5cd46cdf6a3d53a8182763443ab69dc3.tar.gz
org.eclipse.mylyn.tasks-261c304f5cd46cdf6a3d53a8182763443ab69dc3.tar.xz
org.eclipse.mylyn.tasks-261c304f5cd46cdf6a3d53a8182763443ab69dc3.zip
Fixed select
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java12
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java57
2 files changed, 28 insertions, 41 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
index 017eb7e35..662212fe7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
@@ -182,11 +182,13 @@ public class Task implements ITask {
*/
public void notifyTaskDataChange() {
final Task task = this;
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (TaskListView.getDefault() != null) TaskListView.getDefault().notifyTaskDataChanged(task);
- }
- });
+ if (Workbench.getInstance() != null && !Workbench.getInstance().getDisplay().isDisposed()) {
+ Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (TaskListView.getDefault() != null) TaskListView.getDefault().notifyTaskDataChanged(task);
+ }
+ });
+ }
}
public String getToolTipText() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
index 802793a4d..304ee6736 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
@@ -568,46 +568,31 @@ public class TaskListView extends ViewPart {
} else {
return -1;
}
- } else if(o1 instanceof ITask){
+ } else if(o1 instanceof ITaskListElement){
if (o2 instanceof AbstractCategory) {
return -1;
- } else if(o2 instanceof ITask) {
+ } else if(o2 instanceof ITaskListElement) {
- ITask task1 = (ITask) o1;
- ITask task2 = (ITask) o2;
-
- if (task1.isCompleted()) return 1;
- if (task2.isCompleted()) return -1;
- if (column == columnNames[1]) {
- // XXX refactored compare
-// if (task1 instanceof BugzillaTask && !(task2 instanceof BugzillaTask)) {
-// return 1;
-// } else {
-// return -1;
-// }
- } else if (column == columnNames[2]) {
- return task1.getPriority().compareTo(task2.getPriority());
- } else if (column == columnNames[3]) {
- return task1.getLabel().compareTo(task2.getLabel());
- } else {
- return 0;
- }
+ ITask task1 = ((ITaskListElement)o1).getCorrespondingActivatableTask();
+ ITask task2 = ((ITaskListElement)o2).getCorrespondingActivatableTask();
+
+ if (task1.isCompleted()) return 1;
+ if (task2.isCompleted()) return -1;
+ if (column == columnNames[1]) {
+ return 0;
+ // if (task1 instanceof BugzillaTask && !(task2 instanceof BugzillaTask)) {
+ // return 1;
+ // } else {
+ // return -1;
+ // }
+ } else if (column == columnNames[2]) {
+ return task1.getPriority().compareTo(task2.getPriority());
+ } else if (column == columnNames[3]) {
+ return task1.getLabel().compareTo(task2.getLabel());
+ } else {
+ return 0;
+ }
}
-// }
- // XXX refactored compare
-// else if(o1 instanceof BugzillaHit && o2 instanceof BugzillaHit){
-// BugzillaHit task1 = (BugzillaHit) o1;
-// BugzillaHit task2 = (BugzillaHit) o2;
-//
-// if (column == columnNames[1]) {
-// return 0;
-// } else if (column == columnNames[2]) {
-// return task1.getPriority().compareTo(task2.getPriority());
-// } else if (column == columnNames[3]) {
-// return task1.getDescription(false).compareTo(task2.getDescription(false));
-// } else {
-// return 0;
-// }
} else{
return 0;
}

Back to the top