Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-13 19:46:02 -0400
committermkersten2005-07-13 19:46:02 -0400
commit374d6e2e448b99cc69f9280c337a87f1356cb55f (patch)
tree36838ce3b8b7f5c693a70e69d7de29d04061b21c /org.eclipse.mylyn.tasks.ui
parent0847bb10f276259c6bafc8db132ec8e7344fd135 (diff)
downloadorg.eclipse.mylyn.tasks-374d6e2e448b99cc69f9280c337a87f1356cb55f.tar.gz
org.eclipse.mylyn.tasks-374d6e2e448b99cc69f9280c337a87f1356cb55f.tar.xz
org.eclipse.mylyn.tasks-374d6e2e448b99cc69f9280c337a87f1356cb55f.zip
Made externalization more defeinsive
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/DefaultTaskListExternalizer.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java46
2 files changed, 21 insertions, 26 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/DefaultTaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/DefaultTaskListExternalizer.java
index bffe0233c..efd77010e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/DefaultTaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/DefaultTaskListExternalizer.java
@@ -141,7 +141,6 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
}
public boolean canReadTask(Node node) {
- System.err.println("> " + node.getNodeName() + ", " + externalizers);
return node.getNodeName().equals(getTaskTagName());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
index 6682be741..4e9d73527 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
@@ -89,22 +89,17 @@ public class TaskListExternalizer {
for (ITaskListExternalizer externalizer : externalizers) {
externalizer.createRegistry(doc, root);
}
-// writeBugzillaRegistry(tlist.getBugzillaTaskRegistry(), doc, root);
-
- // iterate through each subtask and externalize those
- //
+
for (AbstractCategory category : tlist.getCategories()) {
Element element = null;
for (ITaskListExternalizer externalizer : externalizers) {
if (externalizer.canCreateElementFor(category)) element = externalizer.createCategoryElement(category, doc, root);
}
- if (element == null) defaultExternalizer.createCategoryElement(category, doc, root);
-//
-// if (cat instanceof TaskCategory) {
-// writeTaskCategory((TaskCategory)cat, doc, root);
-// } else if (cat instanceof BugzillaQueryCategory) {
-// writeQueryCategory((BugzillaQueryCategory)cat, doc, root);
-// }
+ if (element == null && defaultExternalizer.canCreateElementFor(category)) {
+ defaultExternalizer.createCategoryElement(category, doc, root);
+ } else {
+ MylarPlugin.log("Did not externalize: " + category, this);
+ }
}
for (ITask task : tlist.getRootTasks()) {
try {
@@ -112,7 +107,11 @@ public class TaskListExternalizer {
for (ITaskListExternalizer externalizer : externalizers) {
if (externalizer.canCreateElementFor(task)) element = externalizer.createTaskElement(task, doc, root);
}
- if (element == null) defaultExternalizer.createTaskElement(task, doc, root);
+ if (element == null && defaultExternalizer.canCreateElementFor(task)) {
+ defaultExternalizer.createTaskElement(task, doc, root);
+ } else {
+ MylarPlugin.log("Did not externalize: " + task, this);
+ }
}catch (Exception e) {
MylarPlugin.log(e, e.getMessage());
}
@@ -216,7 +215,11 @@ public class TaskListExternalizer {
break;
}
}
- if (!wasRead) defaultExternalizer.readCategory(child, tlist);
+ if (!wasRead && defaultExternalizer.canReadCategory(child)) {
+ defaultExternalizer.readCategory(child, tlist);
+ } else {
+ MylarPlugin.log("Did not read: " + child.getNodeName(), this);
+ }
} else {
for (ITaskListExternalizer externalizer : externalizers) {
if (externalizer.canReadTask(child)) {
@@ -231,19 +234,12 @@ public class TaskListExternalizer {
break;
}
}
- if (!wasRead) tlist.addRootTask(defaultExternalizer.readTask(child, tlist, null, null));
+ if (!wasRead && defaultExternalizer.canReadTask(child)) {
+ tlist.addRootTask(defaultExternalizer.readTask(child, tlist, null, null));
+ } else {
+ MylarPlugin.log("Did not read: " + child.getNodeName(), this);
+ }
}
-
-// if (child.getNodeName().equals("Category") ||
-// child.getNodeName().equals("TaskCategory")) {
-// readTaskCategory(child, tlist);
-//// } else if (child.getNodeName().equals("BugzillaTaskRegistry")) {
-//// readBugzillaRegistry(child, tlist);
-// } else if (child.getNodeName().equals("QueryCategory")) {
-// readQueryCategory(child, tlist);
-// } else {
-// tlist.addRootTask(readTask(child, tlist, null, null));
-// }
}
}
} catch (Exception e) {

Back to the top