Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-13 01:22:18 +0000
committermkersten2005-07-13 01:22:18 +0000
commitbe1e5de715cb7f403726dd3d9db59f5a0c8c6dcc (patch)
treef36fd3fdd8eae006892adaf03e48ba1f9c4ec0b3
parent23c8cbf0c6d069ce144d0844eb6071420662b796 (diff)
downloadorg.eclipse.mylyn.tasks-be1e5de715cb7f403726dd3d9db59f5a0c8c6dcc.tar.gz
org.eclipse.mylyn.tasks-be1e5de715cb7f403726dd3d9db59f5a0c8c6dcc.tar.xz
org.eclipse.mylyn.tasks-be1e5de715cb7f403726dd3d9db59f5a0c8c6dcc.zip
Progress on Bugzilla Bug 103099
decouple tasks from mylar.ui
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query-new.gif (renamed from org.eclipse.mylyn.tasks.ui/icons/etool16/category-query-new.gif)bin349 -> 349 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query.gif (renamed from org.eclipse.mylyn.tasks.ui/icons/etool16/category-query.gif)bin332 -> 332 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-new.gif (renamed from org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-new.gif)bin359 -> 359 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-refresh.gif (renamed from org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-refresh.gif)bin362 -> 362 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug.gif (renamed from org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug.gif)bin340 -> 340 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java8
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUiPlugin.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaQueryCategoryAction.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java27
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaAction.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaReportsAction.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaQueryCategory.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTask.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskEditor.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/TaskListActionContributor.java33
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java46
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gifbin0 -> 544 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java29
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java19
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListImages.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java59
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/DefaultTaskListExternalizer.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskListExternalizer.java7
26 files changed, 192 insertions, 93 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/category-query-new.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query-new.gif
index 09fcacad3..09fcacad3 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/category-query-new.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query-new.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/category-query.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query.gif
index 94e7d5d1c..94e7d5d1c 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/category-query.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/category-query.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-new.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-new.gif
index 04f3028c2..04f3028c2 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-new.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-new.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-refresh.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-refresh.gif
index bb8538b39..bb8538b39 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug-refresh.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-refresh.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug.gif
index f2d2f3762..f2d2f3762 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-bug.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug.gif
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
index b5a5ee8c8..8329cc214 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
@@ -59,11 +59,17 @@ public class BugzillaImages {
private static final URL baseURL = BugzillaUiPlugin.getDefault().getBundle().getEntry("/icons/");
public static final String T_ELCL = "elcl16";
+ public static final String T_TOOL = "etool16";
public static final ImageDescriptor IMG_TOOL_ADD_TO_FAVORITES = create(T_ELCL, "bug-favorite.gif");
public static final ImageDescriptor BUG = create(T_ELCL, "bug.gif");
public static final ImageDescriptor IMG_COMMENT = create(T_ELCL, "bug-comment.gif");
-
+ public static final ImageDescriptor TASK_BUGZILLA = create(T_TOOL, "task-bug.gif");
+ public static final ImageDescriptor TASK_BUGZILLA_NEW = create(T_TOOL, "task-bug-new.gif");
+ public static final ImageDescriptor CATEGORY_QUERY = create(T_TOOL, "category-query.gif");
+ public static final ImageDescriptor CATEGORY_QUERY_NEW = create(T_TOOL, "category-query-new.gif");
+ public static final ImageDescriptor TASK_BUG_REFRESH = create(T_TOOL, "task-bug-refresh.gif");
+
private static ImageDescriptor create(String prefix, String name) {
try {
return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUiPlugin.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUiPlugin.java
index e9980248b..0942c6b86 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUiPlugin.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUiPlugin.java
@@ -5,6 +5,7 @@ import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaContentProvider;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTaskExternalizer;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTaskListManager;
+import org.eclipse.mylar.bugzilla.ui.tasks.TaskListActionContributor;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.IWorkbench;
@@ -39,7 +40,8 @@ public class BugzillaUiPlugin extends AbstractUIPlugin implements IStartup {
MylarTasksPlugin.getDefault().getTaskListExternalizer().addExternalizer(
new BugzillaTaskExternalizer()
- );
+ );
+ MylarTasksPlugin.getDefault().setContributor(new TaskListActionContributor());
}
});
}
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 85808f7fd..ed0249cca 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
@@ -15,10 +15,10 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaQueryCategory;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaQueryDialog;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
import org.eclipse.swt.widgets.Display;
@@ -40,7 +40,7 @@ public class CreateBugzillaQueryCategoryAction extends Action {
setText("Add Bugzilla Query");
setToolTipText("Add Bugzilla Query");
setId(ID);
- setImageDescriptor(TaskListImages.CATEGORY_QUERY_NEW);
+ setImageDescriptor(BugzillaImages.CATEGORY_QUERY_NEW);
}
@Override
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
index 8bfe181fd..ee94e1f0d 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
@@ -13,10 +13,10 @@ package org.eclipse.mylar.bugzilla.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -35,7 +35,7 @@ public class CreateBugzillaTaskAction extends Action {
setText("Add Bugzilla Report");
setToolTipText("Add Bugzilla Report");
setId(ID);
- setImageDescriptor(TaskListImages.TASK_BUGZILLA_NEW);
+ setImageDescriptor(BugzillaImages.TASK_BUGZILLA_NEW);
}
@Override
@@ -65,17 +65,26 @@ public class CreateBugzillaTaskAction extends Action {
// return;
// }
- BugzillaTask newBugTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>");
- BugzillaTask bugTask = BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().getFromBugzillaTaskRegistry(newBugTask.getHandle());
- if(bugTask == null) {
- BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().addToBugzillaTaskRegistry((BugzillaTask)bugTask);
- }
+ ITask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>");
Object selectedObject = ((IStructuredSelection)this.view.getViewer().getSelection()).getFirstElement();
if (selectedObject instanceof TaskCategory){
- ((TaskCategory)selectedObject).addTask((ITask)bugTask);
+ ((TaskCategory)selectedObject).addTask(newTask);
} else {
- MylarTasksPlugin.getTaskListManager().getTaskList().addRootTask((ITask)bugTask);
+ MylarTasksPlugin.getTaskListManager().getTaskList().addRootTask(newTask);
}
+ BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().addToBugzillaTaskRegistry((BugzillaTask)newTask);
+//
+// BugzillaTask newBugTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>");
+// BugzillaTask bugTask = BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().getFromBugzillaTaskRegistry(newBugTask.getHandle());
+// if(bugTask == null) {
+// BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().addToBugzillaTaskRegistry((BugzillaTask)bugTask);
+// }
+// Object selectedObject = ((IStructuredSelection)this.view.getViewer().getSelection()).getFirstElement();
+// if (selectedObject instanceof TaskCategory){
+// ((TaskCategory)selectedObject).addTask((ITask)bugTask);
+// } else {
+// MylarTasksPlugin.getTaskListManager().getTaskList().addRootTask((ITask)bugTask);
+// }
this.view.getViewer().refresh();
}
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaAction.java
index 58fb20f7d..ce9c1c35e 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/RefreshBugzillaAction.java
@@ -18,9 +18,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaQueryCategory;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -39,7 +39,7 @@ public class RefreshBugzillaAction extends Action {
setText("Bugzilla Rrefresh");
setToolTipText("Bugzilla Refresh");
setId(ID);
- setImageDescriptor(TaskListImages.TASK_BUG_REFRESH);
+ setImageDescriptor(BugzillaImages.TASK_BUG_REFRESH);
}
@Override
public void run() {
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 ef6dedef0..e98e95464 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
@@ -21,11 +21,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.mylar.bugzilla.core.BugReport;
import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaQueryCategory;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -49,7 +49,7 @@ public class RefreshBugzillaReportsAction extends Action {
setText("Refresh Bugzilla reports");
setToolTipText("Refresh Bugzilla reports");
setId(ID);
- setImageDescriptor(TaskListImages.TASK_BUG_REFRESH);
+ setImageDescriptor(BugzillaImages.TASK_BUG_REFRESH);
}
public void setShowProgress(boolean show) {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaQueryCategory.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaQueryCategory.java
index f8b43d478..f95d385e7 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaQueryCategory.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaQueryCategory.java
@@ -25,6 +25,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchHit;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.search.BugzillaResultCollector;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaCategorySearchOperation.ICategorySearchListener;
@@ -76,7 +77,7 @@ public class BugzillaQueryCategory extends AbstractCategory {
public Image getIcon() {
- return TaskListImages.getImage(TaskListImages.CATEGORY_QUERY);
+ return TaskListImages.getImage(BugzillaImages.CATEGORY_QUERY);
}
public String getUrl() {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTask.java
index 17497787f..ed0ea7035 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTask.java
@@ -33,12 +33,13 @@ import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.bugzilla.core.offline.OfflineReportsFile;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.OfflineView;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
+import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbench;
@@ -483,7 +484,7 @@ public class BugzillaTask extends Task {
}
public Image getIcon() {
- return TaskListImages.getImage(TaskListImages.TASK_BUGZILLA);
+ return TaskListImages.getImage(BugzillaImages.TASK_BUGZILLA);
}
public String getBugUrl() {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskEditor.java
index 950a7766d..3140a9fb2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskEditor.java
@@ -18,12 +18,13 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.mylar.bugzilla.core.BugReport;
import org.eclipse.mylar.bugzilla.core.IBugzillaAttributeListener;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditor;
import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
+import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.ui.TaskEditorInput;
import org.eclipse.mylar.tasks.ui.TaskSummaryEditor;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
@@ -171,7 +172,7 @@ public class BugzillaTaskEditor extends MultiPageEditorPart {
// Set the title on the editor's tab
this.setPartName("Bug #" + bugzillaEditorInput.getBugId());
- this.setTitleImage(TaskListImages.getImage(TaskListImages.TASK_BUGZILLA));
+ this.setTitleImage(TaskListImages.getImage(BugzillaImages.TASK_BUGZILLA));
}
@Override
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
index 4db885c95..67a6d810a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/BugzillaTaskExternalizer.java
@@ -12,21 +12,16 @@
package org.eclipse.mylar.bugzilla.ui.tasks;
import java.util.Date;
-import java.util.List;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask.BugTaskState;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.Task;
-import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.TaskList;
import org.eclipse.mylar.tasks.util.DefaultTaskListExternalizer;
-import org.eclipse.mylar.tasks.util.ITaskListExternalizer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* @author Mik Kersten and Ken Sueda
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/TaskListActionContributor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/TaskListActionContributor.java
index e5afdcb54..3ab8638c7 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/TaskListActionContributor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasks/TaskListActionContributor.java
@@ -11,27 +11,34 @@
package org.eclipse.mylar.bugzilla.ui.tasks;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.action.IAction;
import org.eclipse.mylar.bugzilla.ui.actions.CreateBugzillaQueryCategoryAction;
import org.eclipse.mylar.bugzilla.ui.actions.CreateBugzillaTaskAction;
import org.eclipse.mylar.bugzilla.ui.actions.RefreshBugzillaAction;
import org.eclipse.mylar.bugzilla.ui.actions.RefreshBugzillaReportsAction;
+import org.eclipse.mylar.tasks.ITaskListActionContributor;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
/**
* @author Mik Kersten and Ken Sueda
*/
-public class TaskListActionContributor {
+public class TaskListActionContributor implements ITaskListActionContributor {
+
+ public List<IAction> getToolbarActions(TaskListView view) {
+ List<IAction> actions = new ArrayList<IAction>();
+ actions.add(new CreateBugzillaQueryCategoryAction(view));
+ actions.add(new CreateBugzillaTaskAction(view));
+ actions.add(new RefreshBugzillaReportsAction(view));
+ return actions;
+ }
- private RefreshBugzillaReportsAction refresh;
- private CreateBugzillaQueryCategoryAction createBugzillaQueryCategory;
- private CreateBugzillaTaskAction createBugzillaTask;
- private RefreshBugzillaAction refreshQuery;
-
- public TaskListActionContributor(TaskListView view) {
- refresh = new RefreshBugzillaReportsAction(view);
- createBugzillaQueryCategory = new CreateBugzillaQueryCategoryAction(view);
- createBugzillaTask = new CreateBugzillaTaskAction(view);
- refreshQuery = new RefreshBugzillaAction(view);
- }
-
+ public List<IAction> getPopupActions(TaskListView view) {
+ List<IAction> actions = new ArrayList<IAction>();
+ actions.add(new CreateBugzillaTaskAction(view));
+ actions.add(new RefreshBugzillaAction(view));
+ return actions;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
index 5f866779a..792fd2871 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
@@ -18,6 +18,7 @@ import java.io.File;
import junit.framework.TestCase;
+import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaTask;
import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.ITask;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
@@ -59,9 +60,15 @@ public class TaskListManagerTest extends TestCase {
Task task5 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 5");
cat2.addTask(task5);
Task task6 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 6");
- cat2.addTask(task6);
+ cat2.addTask(task6);
- assertEquals(manager.getTaskList().getRoots().size(), 4);
+ BugzillaTask report = new BugzillaTask("123", "label 123", true);
+ cat2.addTask(report);
+
+ BugzillaTask report2 = new BugzillaTask("124", "label 124", true);
+ tlist.addRootTask(report2);
+
+ assertEquals(manager.getTaskList().getRoots().size(), 5);
manager.saveTaskList();
assertNotNull(manager.getTaskList());
@@ -69,25 +76,24 @@ public class TaskListManagerTest extends TestCase {
manager.setTaskList(list);
manager.readTaskList();
assertNotNull(manager.getTaskList());
- assertEquals(2, manager.getTaskList().getRootTasks().size());
+ assertEquals(3, manager.getTaskList().getRootTasks().size());
assertEquals(2, manager.getTaskList().getCategories().size());
- check(manager);
- }
-
- public boolean check(TaskListManager manager) {
- List<ITask> list = manager.getTaskList().getRootTasks();
- assertTrue(list.get(0).getLabel().equals("task 1"));
- assertTrue(list.get(0).getChildren().get(0).getLabel().equals("sub 1"));
- assertTrue(list.get(1).getLabel().equals("task 2"));
+
+ List<ITask> readList = manager.getTaskList().getRootTasks();
+ assertTrue(readList.get(0).getLabel().equals("task 1"));
+ assertTrue(readList.get(0).getChildren().get(0).getLabel().equals("sub 1"));
+ assertTrue(readList.get(1).getLabel().equals("task 2"));
+ assertTrue(readList.get(2) instanceof BugzillaTask);
- List<TaskCategory> clist = manager.getTaskList().getTaskCategories();
- list = clist.get(0).getChildren();
- assertTrue(list.get(0).getLabel().equals("task 3"));
- assertTrue(list.get(0).getChildren().get(0).getLabel().equals("sub 2"));
- assertTrue(list.get(1).getLabel().equals("task 4"));
- list = clist.get(1).getChildren();
- assertTrue(list.get(0).getLabel().equals("task 5"));
- assertTrue(list.get(1).getLabel().equals("task 6"));
- return true;
+ List<TaskCategory> readCats = manager.getTaskList().getTaskCategories();
+ readList = readCats.get(0).getChildren();
+ assertTrue(readList.get(0).getLabel().equals("task 3"));
+ assertTrue(readList.get(0).getChildren().get(0).getLabel().equals("sub 2"));
+ assertTrue(readList.get(1).getLabel().equals("task 4"));
+ readList = readCats.get(1).getChildren();
+ assertTrue(readList.get(0).getLabel().equals("task 5"));
+ assertTrue(readList.get(1).getLabel().equals("task 6"));
+ assertTrue(readList.get(2) instanceof BugzillaTask);
}
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif
new file mode 100644
index 000000000..2abc46b38
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/elcl16/context-clear.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java
new file mode 100644
index 000000000..d921dad33
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListActionContributor.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.tasks;
+
+import java.util.List;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.mylar.tasks.ui.views.TaskListView;
+
+/**
+ * @author Mik Kersten
+ *
+ * TODO: this should use extension points
+ */
+public interface ITaskListActionContributor {
+
+ public abstract List<IAction> getToolbarActions(TaskListView view);
+
+ public abstract List<IAction> getPopupActions(TaskListView view);
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
index a51dae414..e74def544 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
@@ -19,12 +19,12 @@ import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylar.core.MylarPlugin;
+import org.eclipse.mylar.tasks.ui.views.TaskListView;
import org.eclipse.mylar.tasks.util.TaskListExternalizer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.graphics.Font;
-import org.eclipse.ui.IStartup;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.Workbench;
@@ -39,6 +39,7 @@ public class MylarTasksPlugin extends AbstractUIPlugin {
private static MylarTasksPlugin plugin;
private static TaskListManager taskListManager;
private TaskListExternalizer externalizer;
+ private ITaskListActionContributor contributor; // TODO: use extension points
// TODO: remove hard-coded fonts
public static final Font BOLD = new Font(null, "Tahoma", 8, SWT.BOLD);
@@ -311,4 +312,20 @@ public class MylarTasksPlugin extends AbstractUIPlugin {
public TaskListExternalizer getTaskListExternalizer() {
return externalizer;
}
+
+ public void addActionContributor() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ITaskListActionContributor getContributor() {
+ return contributor;
+ }
+
+ public void setContributor(ITaskListActionContributor contributor) {
+ this.contributor = contributor;
+ if (TaskListView.getDefault() != null) {
+ TaskListView.getDefault().resetToolbarsAndPopups();
+ }
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java
index 604d9050c..18f66cf40 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java
@@ -178,4 +178,10 @@ public class TaskList implements Serializable {
}
return cats;
}
+
+ public void clear() {
+ activeTasks.clear();
+ categories.clear();
+ rootTasks.clear();
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListImages.java
index 2f91b0bcc..e7ac344bf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListImages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListImages.java
@@ -39,21 +39,16 @@ public class TaskListImages {
public static final ImageDescriptor FILTER_PRIORITY = create(T_ELCL, "filter-priority.gif");
public static final ImageDescriptor COLOR_PALETTE = create(T_ELCL, "color-palette.gif");
- public static final ImageDescriptor BUG = create(T_ELCL, "bug.gif");
- public static final ImageDescriptor TASK_BUGZILLA = create(T_TOOL, "task-bug.gif");
- public static final ImageDescriptor TASK_BUGZILLA_NEW = create(T_TOOL, "task-bug-new.gif");
public static final ImageDescriptor TASK = create(T_TOOL, "task.gif");
public static final ImageDescriptor TASK_NEW = create(T_TOOL, "task-new.gif");
public static final ImageDescriptor CATEGORY = create(T_TOOL, "category.gif");
public static final ImageDescriptor CATEGORY_NEW = create(T_TOOL, "category-new.gif");
- public static final ImageDescriptor CATEGORY_QUERY = create(T_TOOL, "category-query.gif");
- public static final ImageDescriptor CATEGORY_QUERY_NEW = create(T_TOOL, "category-query-new.gif");
+
public static final ImageDescriptor TASK_ACTIVE = create(T_TOOL, "task-active.gif");
public static final ImageDescriptor TASK_INACTIVE = create(T_TOOL, "task-inactive.gif");
public static final ImageDescriptor TASK_COMPLETE = create(T_TOOL, "task-complete.gif");
public static final ImageDescriptor TASK_INCOMPLETE = create(T_TOOL, "task-incomplete.gif");
- public static final ImageDescriptor TASK_BUG_REFRESH = create(T_TOOL, "task-bug-refresh.gif");
private static ImageDescriptor create(String prefix, String name) {
try {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
index a01d1c907..b73564396 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
@@ -15,7 +15,6 @@ package org.eclipse.mylar.tasks.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.TaskListImages;
/**
* @author Mik Kersten
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 49e6d1627..456efb533 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
@@ -53,10 +53,10 @@ import org.eclipse.mylar.dt.MylarWebRef;
import org.eclipse.mylar.tasks.AbstractCategory;
import org.eclipse.mylar.tasks.ITask;
import org.eclipse.mylar.tasks.ITaskListElement;
-import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
import org.eclipse.mylar.tasks.TaskCategory;
+import org.eclipse.mylar.tasks.TaskListImages;
import org.eclipse.mylar.tasks.ui.TaskEditorInput;
import org.eclipse.mylar.tasks.ui.actions.ClearContextAction;
import org.eclipse.mylar.tasks.ui.actions.CreateCategoryAction;
@@ -96,9 +96,11 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.part.DrillDownAdapter;
import org.eclipse.ui.part.ViewPart;
@@ -109,8 +111,6 @@ import org.eclipse.ui.part.ViewPart;
public class TaskListView extends ViewPart {
private static TaskListView INSTANCE;
-
- private List<IAction> contributedActions = new ArrayList<IAction>();
TreeViewer viewer;
private DrillDownAdapter drillDownAdapter;
@@ -939,15 +939,17 @@ public class TaskListView extends ViewPart {
void fillContextMenu(IMenuManager manager) {
manager.add(completeTask);
manager.add(incompleteTask);
-// manager.add(new Separator());
- manager.add(createTask);
-// manager.add(createBugzillaTask);
-// manager.add(rename);
manager.add(delete);
- manager.add(clearSelectedTaskscapeAction);
-// manager.add(moveTaskToRoot);
-// manager.add(refreshQuery);
manager.add(new Separator());
+ manager.add(createTask);
+// manager.add(new Separator());
+ if (MylarTasksPlugin.getDefault().getContributor() != null) {
+ for (IAction action : MylarTasksPlugin.getDefault().getContributor().getPopupActions(this)) {
+ manager.add(action);
+ }
+ }
+ manager.add(new Separator());
+ manager.add(clearSelectedTaskscapeAction);
MenuManager subMenuManager = new MenuManager("Choose Highlighter");
final Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
@@ -982,10 +984,9 @@ public class TaskListView extends ViewPart {
updateActionEnablement(selectedObject);
}
- private void updateActionEnablement(Object sel){
- // XXX refactored
- throw new RuntimeException("unimplemented");
+ private void updateActionEnablement(Object sel) {
// if(sel != null && sel instanceof ITaskListElement){
+// // TODO: use enables for part of contribution
// if(sel instanceof BugzillaHit){
// BugzillaTask task = ((BugzillaHit)sel).getAssociatedTask();
// if(task == null){
@@ -1039,12 +1040,13 @@ public class TaskListView extends ViewPart {
manager.add(createTask);
manager.add(createCategory);
manager.add(new Separator());
-// manager.add(createBugzillaTask);
-// manager.add(createBugzillaQueryCategory);
-// manager.add(refresh);
-// manager.add(new Separator());
+ if (MylarTasksPlugin.getDefault().getContributor() != null) {
+ for (IAction action : MylarTasksPlugin.getDefault().getContributor().getToolbarActions(this)) {
+ manager.add(action);
+ }
+ }
+ manager.add(new Separator());
manager.add(filterCompleteTask);
-// manager.add(filterInCompleteTask);
manager.add(filterOnPriority);
}
@@ -1279,7 +1281,24 @@ public class TaskListView extends ViewPart {
super.configureShell(shell);
shell.setText("Enter Task Name");
}
- };
+ }
+
+ public void resetToolbarsAndPopups() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ workbench.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ getViewSite().getActionBars().getToolBarManager().removeAll();
+ getViewSite().getActionBars().getMenuManager().removeAll();
+ fillLocalToolBar(getViewSite().getActionBars().getToolBarManager());
+ fillContextMenu(getViewSite().getActionBars().getMenuManager());
+ IActionBars bars = getViewSite().getActionBars();
+ bars.updateActionBars();
+ getViewSite().getActionBars().getMenuManager().update(true);
+ getViewSite().getActionBars().getToolBarManager().update(true);
+ viewer.refresh();
+ }
+ });
+ }
}
//TextTransfer textTransfer = TextTransfer.getInstance();
@@ -1287,7 +1306,7 @@ public class TaskListView extends ViewPart {
//target.setTransfer(new Transfer[] { textTransfer });
//target.addDropListener(new TaskListDropTargetListener(parent, null, textTransfer, true));
//
-//DragSource source = new DragSource(viewer.getTree(), DND.DROP_MOVE);
+//DragSource source = new DragSouarce(viewer.getTree(), DND.DROP_MOVE);
//source.setTransfer(types);
//source.addDragListener(new DragSourceListener() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/DefaultTaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/DefaultTaskListExternalizer.java
index 9170dcace..10b4a4702 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/DefaultTaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/DefaultTaskListExternalizer.java
@@ -63,9 +63,13 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
Element node = doc.createElement(getCategoryTagName());
node.setAttribute(NAME, category.getDescription(false));
- for (ITask t : ((TaskCategory)category).getChildren()) {
+ for (ITask task : ((TaskCategory)category).getChildren()) {
try {
- createTaskElement(t, doc, node);
+ Element element = null;
+ for (ITaskListExternalizer externalizer : externalizers) {
+ if (externalizer.canCreateElementFor(task)) element = externalizer.createTaskElement(task, doc, node);
+ }
+ if (element == null) createTaskElement(task, doc, node);
} catch (Exception e) {
MylarPlugin.log(e, e.getMessage());
}
@@ -138,6 +142,7 @@ 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/util/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskListExternalizer.java
index 78de68836..ef6d2314d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskListExternalizer.java
@@ -48,14 +48,15 @@ import org.xml.sax.SAXException;
public class TaskListExternalizer {
private List<ITaskListExternalizer> externalizers = new ArrayList<ITaskListExternalizer>();
- private ITaskListExternalizer defaultExternalizer = new DefaultTaskListExternalizer();
+ private DefaultTaskListExternalizer defaultExternalizer = new DefaultTaskListExternalizer();
private String readVersion = "";
public void addExternalizer(ITaskListExternalizer externalizer) {
externalizers.add(externalizer);
-// System.err.println(">>>>>>>>> " + MylarTasksPlugin.getTaskListManager().getTaskListFile());
-// readTaskList(MylarTasksPlugin.getTaskListManager().getTaskList(), MylarTasksPlugin.getTaskListManager().getTaskListFile());
+ defaultExternalizer.setExternalizers(externalizers);
+ MylarTasksPlugin.getTaskListManager().getTaskList().clear();
+ readTaskList(MylarTasksPlugin.getTaskListManager().getTaskList(), MylarTasksPlugin.getTaskListManager().getTaskListFile());
}
public void removeExternalizer(ITaskListExternalizer externalizer) {

Back to the top