Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-07-18 20:35:33 +0000
committersminto2005-07-18 20:35:33 +0000
commit3782632e2f35ed2e137eaf396168df6548bbc7dd (patch)
tree40e6d05cd54c9d081b26c4c2dbc70c3f99174f06 /org.eclipse.mylyn.tasks.ui
parent43bc321712f72e67d21f8280edee3e6780bc4407 (diff)
downloadorg.eclipse.mylyn.tasks-3782632e2f35ed2e137eaf396168df6548bbc7dd.tar.gz
org.eclipse.mylyn.tasks-3782632e2f35ed2e137eaf396168df6548bbc7dd.tar.xz
org.eclipse.mylyn.tasks-3782632e2f35ed2e137eaf396168df6548bbc7dd.zip
Fixed Bug #104118: Bugzilla refresh fails if task active
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java26
2 files changed, 16 insertions, 12 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
index 7a7508dad..93010fe41 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
@@ -60,5 +60,5 @@ public abstract class AbstractCategory implements ITaskListElement {
return null;
}
- public abstract List<?> getChildren();
+ public abstract List<? extends ITaskListElement> getChildren();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
index f53a3c367..bbe8a06e6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
@@ -19,6 +19,7 @@ import java.util.List;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
+import org.eclipse.mylar.tasks.ITaskListElement;
/**
@@ -80,24 +81,27 @@ public class TaskList implements Serializable {
/**
* TODO: make data structure handle this traversal
*/
- public ITask getTaskForId(String id) {
+ public ITask getTaskForHandle(String handle) {
ITask t = null;
- for (TaskCategory cat : getTaskCategories()) {
- if ((t = findTaskHelper(cat.getChildren(), id)) != null) {
+ for (AbstractCategory cat : categories) {
+ if ((t = findTaskHelper(cat.getChildren(), handle)) != null) {
return t;
}
}
- return findTaskHelper(rootTasks, id);
+ return findTaskHelper(rootTasks, handle);
}
- private ITask findTaskHelper(List<ITask> tasks, String id) {
- for (ITask task : tasks) {
- if (task.getHandle() == id) {
- return task;
+ private ITask findTaskHelper(List<? extends ITaskListElement> elements, String handle) {
+ for (ITaskListElement element : elements) {
+ if (element.getHandle() == handle && element.hasCorrespondingActivatableTask()) {
+ return element.getOrCreateCorrespondingTask();
}
- ITask t = findTaskHelper(task.getChildren(), id);
- if (t != null) {
- return t;
+ if(element instanceof ITask){
+ ITask searchTask = (ITask)element;
+ ITask t = findTaskHelper(searchTask.getChildren(), handle);
+ if (t != null) {
+ return t;
+ }
}
}
return null;

Back to the top