Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-14 13:53:37 -0400
committermkersten2005-07-14 13:53:37 -0400
commit4497ce0d5d24fb5a16960fff8644c045691bd3c1 (patch)
treeb0e020b4db2b9a87579549562d460b36da4326e8 /org.eclipse.mylyn.tasks.ui
parent3b17263b60250a970b45c9bbac341b7439694361 (diff)
downloadorg.eclipse.mylyn.tasks-4497ce0d5d24fb5a16960fff8644c045691bd3c1.tar.gz
org.eclipse.mylyn.tasks-4497ce0d5d24fb5a16960fff8644c045691bd3c1.tar.xz
org.eclipse.mylyn.tasks-4497ce0d5d24fb5a16960fff8644c045691bd3c1.zip
Fix for: Bugzilla Bug 103744
bugzilla reports are not refreshed
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskCategory.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java33
4 files changed, 23 insertions, 21 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
index 745e2975c..066dca76a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
@@ -39,7 +39,7 @@ public interface ITaskListElement {
/**
* Used for wrapping bugzilla hits
*/
- public ITask getCorrespondingActivatableTask();
+ public ITask getOrCreateCorrespondingTask();
public abstract boolean hasCorrespondingActivatableTask();
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 662212fe7..dbab24c0e 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
@@ -395,7 +395,7 @@ public class Task implements ITask {
return true;
}
- public ITask getCorrespondingActivatableTask() {
+ public ITask getOrCreateCorrespondingTask() {
return this;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskCategory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskCategory.java
index 7c75640eb..d11b28360 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskCategory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskCategory.java
@@ -43,8 +43,11 @@ public class TaskCategory extends AbstractCategory implements Serializable {
}
- public String getPriority() {
+ public String getPriority() {
String highestPriority = "P5";
+ if (tasks.isEmpty()) {
+ return "P1";
+ }
for (ITask task : tasks) {
if (highestPriority.compareTo(task.getPriority()) > 0) {
highestPriority = task.getPriority();
@@ -76,7 +79,7 @@ public class TaskCategory extends AbstractCategory implements Serializable {
}
}
- public ITask getCorrespondingActivatableTask() {
+ public ITask getOrCreateCorrespondingTask() {
return null;
}
public boolean hasCorrespondingActivatableTask() {
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 17728290a..22b1413d8 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
@@ -277,7 +277,7 @@ public class TaskListView extends ViewPart {
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof ITaskListElement) {
if(element instanceof ITask && ((ITaskListElement)element).hasCorrespondingActivatableTask()){
- ITask task = ((ITaskListElement)element).getCorrespondingActivatableTask();
+ ITask task = ((ITaskListElement)element).getOrCreateCorrespondingTask();
if(task != null){
return !task.isCompleted();
} else {
@@ -445,7 +445,7 @@ public class TaskListView extends ViewPart {
final ITaskListElement taskListElement = (ITaskListElement)element;
ITask task = null;
if(taskListElement.hasCorrespondingActivatableTask()){
- task = taskListElement.getCorrespondingActivatableTask();
+ task = taskListElement.getOrCreateCorrespondingTask();
}
switch (columnIndex) {
case 0:
@@ -505,11 +505,11 @@ public class TaskListView extends ViewPart {
final ITaskListElement taskListElement = (ITaskListElement) ((TreeItem) element).getData();
ITask task = null;
if(taskListElement.hasCorrespondingActivatableTask()){
- task = taskListElement.getCorrespondingActivatableTask();
+ task = taskListElement.getOrCreateCorrespondingTask();
}
switch (columnIndex) {
case 0:
- task = taskListElement.getCorrespondingActivatableTask();
+ task = taskListElement.getOrCreateCorrespondingTask();
if (task != null) {
if (task.isActive()) {
new TaskDeactivateAction(task, INSTANCE).run();
@@ -571,23 +571,22 @@ public class TaskListView extends ViewPart {
if (o2 instanceof AbstractCategory) {
return -1;
} else if(o2 instanceof ITaskListElement) {
-
- ITask task1 = ((ITaskListElement)o1).getCorrespondingActivatableTask();
- ITask task2 = ((ITaskListElement)o2).getCorrespondingActivatableTask();
-
- if (task1.isCompleted()) return 1;
- if (task2.isCompleted()) return -1;
+ ITaskListElement element1 = (ITaskListElement) o1;
+ ITaskListElement element2 = (ITaskListElement) o2;
+
+ if (element1.hasCorrespondingActivatableTask() && element2.hasCorrespondingActivatableTask()) {
+ ITask task1 = element1.getOrCreateCorrespondingTask();
+ ITask task2 = element2.getOrCreateCorrespondingTask();
+
+ 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());
+ return element1.getPriority().compareTo(element2.getPriority());
} else if (column == columnNames[3]) {
- return task1.getLabel().compareTo(task2.getLabel());
+ return element1.getDescription(true).compareTo(element2.getDescription(true));
} else {
return 0;
}

Back to the top